001 /**
002 * Copyright 2010 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 */
015
016 package org.kuali.student.r2.lum.lo.entity;
017
018 import java.util.Date;
019 import java.util.List;
020
021 import javax.persistence.CascadeType;
022 import javax.persistence.Column;
023 import javax.persistence.Entity;
024 import javax.persistence.JoinColumn;
025 import javax.persistence.ManyToOne;
026 import javax.persistence.OneToMany;
027 import javax.persistence.Table;
028 import javax.persistence.Temporal;
029 import javax.persistence.TemporalType;
030
031 import org.kuali.student.r1.common.entity.AttributeOwner;
032 import org.kuali.student.r1.common.entity.MetaEntity;
033
034 @Entity
035 @Table(name = "KSLO_LO_RELTN")
036 public class LoLoRelation extends MetaEntity implements AttributeOwner<LoLoRelationAttribute> {
037
038 @ManyToOne
039 @JoinColumn(name="LO_ID")
040 private Lo lo;
041
042 @ManyToOne
043 @JoinColumn(name="RELATED_LO_ID")
044 private Lo relatedLo;
045
046 @ManyToOne
047 @JoinColumn(name="LO_LO_RELATION_TYPE_ID")
048 private LoLoRelationType loLoRelationType;
049
050 @Column(name = "ST")
051 private String state;
052
053 @Temporal(TemporalType.TIMESTAMP)
054 @Column(name = "EFF_DT")
055 private Date effectiveDate;
056
057 @Temporal(TemporalType.TIMESTAMP)
058 @Column(name = "EXPIR_DT")
059 private Date expirationDate;
060
061 @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
062 private List<LoLoRelationAttribute> attributes;
063
064 public void setLo(Lo lo) {
065 this.lo = lo;
066 }
067
068 public Lo getLo() {
069 return lo;
070 }
071
072 public void setRelatedLo(Lo relatedLo) {
073 this.relatedLo = relatedLo;
074 }
075
076 public Lo getRelatedLo() {
077 return relatedLo;
078 }
079
080 /**
081 * @param effectiveDate the effectiveDate to set
082 */
083 public void setEffectiveDate(Date effectiveDate) {
084 this.effectiveDate = effectiveDate;
085 }
086
087 /**
088 * @return the effectiveDate
089 */
090 public Date getEffectiveDate() {
091 return effectiveDate;
092 }
093
094 /**
095 * @param expirationDate the expirationDate to set
096 */
097 public void setExpirationDate(Date expirationDate) {
098 this.expirationDate = expirationDate;
099 }
100
101 /**
102 * @return the expirationDate
103 */
104 public Date getExpirationDate() {
105 return expirationDate;
106 }
107
108 @Override
109 public List<LoLoRelationAttribute> getAttributes() {
110 return attributes;
111 }
112
113 @Override
114 public void setAttributes(List<LoLoRelationAttribute> attributes) {
115 this.attributes = attributes;
116 }
117
118 public void setLoLoRelationType(LoLoRelationType loLoRelationType) {
119 this.loLoRelationType = loLoRelationType;
120 }
121
122 public LoLoRelationType getLoLoRelationType() {
123 return loLoRelationType;
124 }
125
126 public void setState(String state) {
127 this.state = state;
128 }
129
130 public String getState() {
131 return state;
132 }
133 }