Skip to content

Commit

Permalink
Add export views join with analytic views
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Aug 1, 2023
1 parent 607f9a6 commit 57c2385
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
package edu.tamu.scholars.middleware.view.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name = "analytic_views")
public class AnalyticView extends CollectionView {
Expand All @@ -16,6 +24,11 @@ public class AnalyticView extends CollectionView {
@Enumerated(EnumType.STRING)
private ContainerType type;

@JoinColumn(name = "analytic_export_view_id")
@OneToMany(cascade = CascadeType.ALL)
@LazyCollection(LazyCollectionOption.FALSE)
private List<ExportView> exportViews;

public AnalyticView() {
super();
}
Expand All @@ -28,4 +41,16 @@ public void setGraph(ContainerType type) {
this.type = type;
}

public void setType(ContainerType type) {
this.type = type;
}

public List<ExportView> getExportViews() {
return exportViews;
}

public void setExportViews(List<ExportView> exportViews) {
this.exportViews = exportViews;
}

}
5 changes: 5 additions & 0 deletions src/main/resources/defaults/analyticViews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
- name: Download Profile Summaries by Department
layout: CONTAINER
type: SUMMARY_PROFILE_EXPORT
exportViews:
- name: 5 Year Publications
- name: 8 Year Publications
# contentTemplate: "defaults/displayViews/persons/5YearPublicationsContentTemplate.html"
# headerTemplate: "defaults/displayViews/emptyHeaderTemplate.html"

0 comments on commit 57c2385

Please sign in to comment.