1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  package org.kuali.student.core.comment.entity;
17  
18  import java.util.List;
19  
20  import javax.persistence.CascadeType;
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.JoinColumn;
24  import javax.persistence.ManyToOne;
25  import javax.persistence.NamedQueries;
26  import javax.persistence.NamedQuery;
27  import javax.persistence.OneToMany;
28  import javax.persistence.Table;
29  import javax.persistence.UniqueConstraint;
30  
31  import org.kuali.student.common.entity.BaseEntity;
32  
33  @Entity
34  @Table(name = "KSCO_REFERENCE",
35          uniqueConstraints= @UniqueConstraint(columnNames={"REFERENCE_ID", "REFERENCE_TYPE"}))
36  @NamedQueries( {
37          @NamedQuery(name = "Reference.getReference", query = "SELECT reference FROM Reference reference WHERE reference.referenceId =:refId AND reference.referenceType.id=:refTypeId")})
38  public class Reference extends BaseEntity {
39      @Column(name="REFERENCE_ID")
40      private String referenceId;
41  
42      @ManyToOne
43      @JoinColumn(name = "REFERENCE_TYPE")
44      private ReferenceType referenceType;
45  
46      @OneToMany(cascade = CascadeType.ALL, mappedBy="reference")
47      private List<Tag> tags;
48  
49      @OneToMany(cascade = CascadeType.ALL, mappedBy="reference")
50      private List<Comment> comments;
51  
52      public String getReferenceId(){
53          return referenceId;
54      }
55  
56      public void setReferenceId(String referenceId){
57          this.referenceId=referenceId;
58      }
59  
60      public ReferenceType getReferenceType(){
61          return referenceType;
62      }
63  
64      public void setReferenceType(ReferenceType referenceType){
65          this.referenceType=referenceType;
66      }
67  
68      public List<Tag> getTags(){
69          return tags;
70      }
71  
72      public void setTags(List<Tag> tags){
73          this.tags=tags;
74      }
75  
76      public List<Comment> getCommentss(){
77          return comments;
78      }
79  
80      public void setComments(List<Comment> comments){
81          this.comments=comments;
82      }
83  }