Coverage Report - org.kuali.student.core.organization.entity.Org
 
Classes in this File Line Coverage Branch Coverage Complexity
Org
90%
28/31
N/A
1
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 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.NamedQueries;
 29  
 import javax.persistence.NamedQuery;
 30  
 import javax.persistence.OneToMany;
 31  
 import javax.persistence.Table;
 32  
 import javax.persistence.Temporal;
 33  
 import javax.persistence.TemporalType;
 34  
 
 35  
 import org.kuali.student.core.entity.AttributeOwner;
 36  
 import org.kuali.student.core.entity.KSEntityConstants;
 37  
 import org.kuali.student.core.entity.MetaEntity;
 38  
 
 39  
 @Entity
 40  
 @Table(name="KSOR_ORG")
 41  
 @NamedQueries({
 42  
         @NamedQuery(name="Org.getOrganizationsByIdList", query="SELECT o FROM Org o WHERE o.id IN (:orgIdList)")
 43  
 })
 44  88
 public class Org extends MetaEntity implements AttributeOwner<OrgAttribute>{
 45  
         
 46  
         @Column(name = "LNG_NAME")
 47  
         private String longName; 
 48  
         
 49  
         @Column(name = "SHRT_NAME")
 50  
         private String shortName; 
 51  
         
 52  
         @Column(name = "SHRT_DESCR",length=KSEntityConstants.SHORT_TEXT_LENGTH)
 53  
         private String shortDesc; 
 54  
         
 55  
         @Column(name = "LNG_DESCR",length=KSEntityConstants.LONG_TEXT_LENGTH)
 56  
         private String longDesc; 
 57  
         
 58  
         @Temporal(TemporalType.TIMESTAMP)
 59  
         @Column(name = "EFF_DT")
 60  
         private Date effectiveDate;
 61  
         
 62  
         @Temporal(TemporalType.TIMESTAMP)
 63  
         @Column(name = "EXPIR_DT")
 64  
         private Date expirationDate; 
 65  
         
 66  
         @OneToMany(cascade = CascadeType.ALL, mappedBy = "owner")
 67  
         private List<OrgAttribute> attributes;
 68  
         
 69  
         @ManyToOne
 70  
     @JoinColumn(name="TYPE")
 71  
         private OrgType type; 
 72  
         
 73  
         @ManyToMany
 74  
         @JoinTable(
 75  
                 name="KSOR_ORG_JN_ORG_PERS_REL_TYPE",
 76  
                 joinColumns=
 77  
                     @JoinColumn(name="ORG_ID", referencedColumnName="ID"),
 78  
                 inverseJoinColumns=
 79  
                     @JoinColumn(name="ORG_PERS_RELTN_TYPE_ID", referencedColumnName="TYPE_KEY")
 80  
             )
 81  
         private List<OrgPersonRelationType> orgPersonRelationTypes;
 82  
 
 83  
         @Column(name = "ST")
 84  
         private String state;
 85  
         
 86  
         @Override
 87  
         public List<OrgAttribute> getAttributes() {
 88  20
                 return attributes;
 89  
         }
 90  
 
 91  
         @Override
 92  
         public void setAttributes(List<OrgAttribute> attributes) {
 93  5
                 this.attributes=attributes;
 94  5
         }
 95  
 
 96  
         public String getLongName() {
 97  7
                 return longName;
 98  
         }
 99  
 
 100  
         public void setLongName(String longName) {
 101  2
                 this.longName = longName;
 102  2
         }
 103  
 
 104  
         public String getShortName() {
 105  10
                 return shortName;
 106  
         }
 107  
 
 108  
         public void setShortName(String shortName) {
 109  5
                 this.shortName = shortName;
 110  5
         }
 111  
 
 112  
         public Date getEffectiveDate() {
 113  5
                 return effectiveDate;
 114  
         }
 115  
 
 116  
         public void setEffectiveDate(Date effectiveDate) {
 117  2
                 this.effectiveDate = effectiveDate;
 118  2
         }
 119  
 
 120  
         public Date getExpirationDate() {
 121  5
                 return expirationDate;
 122  
         }
 123  
 
 124  
         public void setExpirationDate(Date expirationDate) {
 125  2
                 this.expirationDate = expirationDate;
 126  2
         }
 127  
 
 128  
         public OrgType getType() {
 129  5
                 return type;
 130  
         }
 131  
 
 132  
         public void setType(OrgType type) {
 133  5
                 this.type = type;
 134  5
         }
 135  
 
 136  
         public String getState() {
 137  5
                 return state;
 138  
         }
 139  
 
 140  
         public void setState(String state) {
 141  2
                 this.state = state;
 142  2
         } 
 143  
         
 144  
         public List<OrgPersonRelationType> getOrgPersonRelationTypes() {
 145  0
                 return orgPersonRelationTypes;
 146  
         }
 147  
 
 148  
         public void setOrgPersonRelationTypes(List<OrgPersonRelationType> orgPersonRelationTypes) {
 149  0
                 this.orgPersonRelationTypes = orgPersonRelationTypes;
 150  0
         }
 151  
 
 152  
         public void setShortDesc(String shortDesc) {
 153  5
                 this.shortDesc = shortDesc;
 154  5
         }
 155  
 
 156  
         public String getShortDesc() {
 157  5
                 return shortDesc;
 158  
         }
 159  
 
 160  
         public void setLongDesc(String longDesc) {
 161  5
                 this.longDesc = longDesc;
 162  5
         }
 163  
 
 164  
         public String getLongDesc() {
 165  5
                 return longDesc;
 166  
         }
 167  
 }