| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.student.core.organization.entity; |
| 17 | |
|
| 18 | |
import java.util.Date; |
| 19 | |
import java.util.List; |
| 20 | |
|
| 21 | |
import javax.persistence.CascadeType; |
| 22 | |
import javax.persistence.Column; |
| 23 | |
import javax.persistence.Entity; |
| 24 | |
import javax.persistence.JoinColumn; |
| 25 | |
import javax.persistence.JoinTable; |
| 26 | |
import javax.persistence.ManyToMany; |
| 27 | |
import javax.persistence.ManyToOne; |
| 28 | |
import javax.persistence.OneToMany; |
| 29 | |
import javax.persistence.Table; |
| 30 | |
import javax.persistence.Temporal; |
| 31 | |
import javax.persistence.TemporalType; |
| 32 | |
|
| 33 | |
import org.kuali.student.common.entity.AttributeOwner; |
| 34 | |
import org.kuali.student.common.entity.BaseEntity; |
| 35 | |
import org.kuali.student.common.entity.KSEntityConstants; |
| 36 | |
|
| 37 | |
@Entity |
| 38 | |
@Table(name="KSOR_ORG_HIRCHY") |
| 39 | 0 | public class OrgHierarchy extends BaseEntity implements AttributeOwner<OrgHierarchyAttribute>{ |
| 40 | |
|
| 41 | |
@Column(name = "NAME") |
| 42 | |
private String name; |
| 43 | |
|
| 44 | |
@Column(name = "DESCR",length=KSEntityConstants.LONG_TEXT_LENGTH) |
| 45 | |
private String descr; |
| 46 | |
|
| 47 | |
@ManyToOne |
| 48 | |
@JoinColumn(name="ROOT_ORG") |
| 49 | |
private Org rootOrg; |
| 50 | |
|
| 51 | |
@Temporal(TemporalType.TIMESTAMP) |
| 52 | |
@Column(name = "EFF_DT") |
| 53 | |
private Date effectiveDate; |
| 54 | |
|
| 55 | |
@Temporal(TemporalType.TIMESTAMP) |
| 56 | |
@Column(name = "EXPIR_DT") |
| 57 | |
private Date expirationDate; |
| 58 | |
|
| 59 | |
@ManyToMany |
| 60 | |
@JoinTable( |
| 61 | |
name="KSOR_ORG_HIRCHY_JN_ORG_TYPE", |
| 62 | |
joinColumns= |
| 63 | |
@JoinColumn(name="ORG_HIRCHY_ID", referencedColumnName="ID"), |
| 64 | |
inverseJoinColumns= |
| 65 | |
@JoinColumn(name="ORG_TYPE_ID", referencedColumnName="TYPE_KEY") |
| 66 | |
) |
| 67 | |
private List<OrgType> organizationTypes; |
| 68 | |
|
| 69 | |
@OneToMany(mappedBy = "orgHierarchy") |
| 70 | |
private List<OrgOrgRelationType> orgOrgRelationTypes; |
| 71 | |
|
| 72 | |
@OneToMany(cascade = CascadeType.ALL, mappedBy = "owner") |
| 73 | |
private List<OrgHierarchyAttribute> attributes; |
| 74 | |
|
| 75 | |
@Override |
| 76 | |
public List<OrgHierarchyAttribute> getAttributes() { |
| 77 | 0 | return attributes; |
| 78 | |
} |
| 79 | |
|
| 80 | |
@Override |
| 81 | |
public void setAttributes(List<OrgHierarchyAttribute> attributes) { |
| 82 | 0 | this.attributes=attributes; |
| 83 | 0 | } |
| 84 | |
|
| 85 | |
public String getName() { |
| 86 | 0 | return name; |
| 87 | |
} |
| 88 | |
|
| 89 | |
public void setName(String name) { |
| 90 | 0 | this.name = name; |
| 91 | 0 | } |
| 92 | |
|
| 93 | |
public String getDescr() { |
| 94 | 0 | return descr; |
| 95 | |
} |
| 96 | |
|
| 97 | |
public void setDescr(String descr) { |
| 98 | 0 | this.descr = descr; |
| 99 | 0 | } |
| 100 | |
|
| 101 | |
public Org getRootOrg() { |
| 102 | 0 | return rootOrg; |
| 103 | |
} |
| 104 | |
|
| 105 | |
public void setRootOrg(Org rootOrg) { |
| 106 | 0 | this.rootOrg = rootOrg; |
| 107 | 0 | } |
| 108 | |
|
| 109 | |
public Date getEffectiveDate() { |
| 110 | 0 | return effectiveDate; |
| 111 | |
} |
| 112 | |
|
| 113 | |
public void setEffectiveDate(Date effectiveDate) { |
| 114 | 0 | this.effectiveDate = effectiveDate; |
| 115 | 0 | } |
| 116 | |
|
| 117 | |
public Date getExpirationDate() { |
| 118 | 0 | return expirationDate; |
| 119 | |
} |
| 120 | |
|
| 121 | |
public void setExpirationDate(Date expirationDate) { |
| 122 | 0 | this.expirationDate = expirationDate; |
| 123 | 0 | } |
| 124 | |
|
| 125 | |
public List<OrgType> getOrganizationTypes() { |
| 126 | 0 | return organizationTypes; |
| 127 | |
} |
| 128 | |
|
| 129 | |
public void setOrganizationTypes(List<OrgType> organizationTypes) { |
| 130 | 0 | this.organizationTypes = organizationTypes; |
| 131 | 0 | } |
| 132 | |
|
| 133 | |
public List<OrgOrgRelationType> getOrgOrgRelationTypes() { |
| 134 | 0 | return orgOrgRelationTypes; |
| 135 | |
} |
| 136 | |
|
| 137 | |
public void setOrgOrgRelationTypes(List<OrgOrgRelationType> orgOrgRelationTypes) { |
| 138 | 0 | this.orgOrgRelationTypes = orgOrgRelationTypes; |
| 139 | 0 | } |
| 140 | |
|
| 141 | |
} |