1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.core.proposal.entity;
17
18 import java.util.List;
19
20 import javax.persistence.AttributeOverride;
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.FetchType;
24 import javax.persistence.JoinColumn;
25 import javax.persistence.ManyToMany;
26 import javax.persistence.ManyToOne;
27 import javax.persistence.NamedQueries;
28 import javax.persistence.NamedQuery;
29 import javax.persistence.Table;
30
31 import org.kuali.student.common.entity.BaseEntity;
32
33
34
35
36
37
38
39 @Entity
40 @Table(name = "KSPR_PROPOSAL_REFERENCE")
41 @NamedQueries( {
42 @NamedQuery(name = "ProposalReference.getObjectReference", query = "SELECT o FROM ProposalReference o WHERE o.objectReferenceId = :objectReferenceId AND o.type.id = :objectReferenceType")
43 })
44 @AttributeOverride(name="id", column=@Column(name="REFERENCE_ID"))
45 public class ProposalReference extends BaseEntity{
46
47 @ManyToMany(mappedBy="proposalReference",fetch=FetchType.EAGER)
48 private List<Proposal> proposals;
49
50 @Column(name = "OBJECT_REFERENCE_ID")
51 private String objectReferenceId;
52
53 @ManyToOne(optional=true)
54 @JoinColumn(name = "TYPE")
55 private ProposalReferenceType type;
56
57 public List<Proposal> getProposals() {
58 return proposals;
59 }
60
61 public void setProposals(List<Proposal> proposals) {
62 this.proposals = proposals;
63 }
64
65 public String getObjectReferenceId() {
66 return objectReferenceId;
67 }
68
69 public void setObjectReferenceId(String objectReferenceId) {
70 this.objectReferenceId = objectReferenceId;
71 }
72
73 public ProposalReferenceType getType() {
74 return type;
75 }
76
77 public void setType(ProposalReferenceType type) {
78 this.type = type;
79 }
80 }