Coverage Report - org.kuali.rice.kim.bo.entity.impl.KimEntityEntityTypeImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
KimEntityEntityTypeImpl
0%
0/30
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007-2008 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kim.bo.entity.impl;
 17  
 
 18  
 import java.util.LinkedHashMap;
 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.FetchType;
 25  
 import javax.persistence.Id;
 26  
 import javax.persistence.JoinColumn;
 27  
 import javax.persistence.ManyToOne;
 28  
 import javax.persistence.OneToMany;
 29  
 import javax.persistence.Table;
 30  
 
 31  
 import org.kuali.rice.kim.bo.entity.KimEntityAddress;
 32  
 import org.kuali.rice.kim.bo.entity.KimEntityEmail;
 33  
 import org.kuali.rice.kim.bo.entity.KimEntityEntityType;
 34  
 import org.kuali.rice.kim.bo.entity.KimEntityPhone;
 35  
 import org.kuali.rice.kim.bo.reference.EntityType;
 36  
 import org.kuali.rice.kim.bo.reference.impl.EntityTypeImpl;
 37  
 import org.kuali.rice.kns.util.TypedArrayList;
 38  
 
 39  
 /**
 40  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 41  
  */
 42  
 @Entity
 43  
 @Table(name = "KRIM_ENTITY_ENT_TYP_T")
 44  0
 public class KimEntityEntityTypeImpl extends KimInactivatableEntityDataBase implements KimEntityEntityType {
 45  
 
 46  
         private static final long serialVersionUID = 1L;
 47  
 
 48  
         @Id
 49  
         @Column(name = "ENTITY_ID")
 50  
         protected String entityId;
 51  
 
 52  
         @Id
 53  
         @Column(name = "ENT_TYP_CD")
 54  
         protected String entityTypeCode;
 55  
          
 56  
         @ManyToOne(targetEntity = EntityTypeImpl.class, fetch = FetchType.LAZY, cascade = {})
 57  
         @JoinColumn(name = "ENT_TYP_CD", insertable = false, updatable = false)
 58  
         protected EntityType entityType;
 59  
         
 60  0
         @OneToMany(targetEntity = KimEntityEmailImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
 61  
         @JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false)
 62  
         protected List<KimEntityEmail> emailAddresses = new TypedArrayList(KimEntityEmailImpl.class);
 63  
         
 64  0
         @OneToMany(targetEntity = KimEntityPhoneImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
 65  
         @JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false)
 66  
         protected List<KimEntityPhone> phoneNumbers = new TypedArrayList(KimEntityPhoneImpl.class);
 67  
         
 68  0
         @OneToMany(targetEntity = KimEntityAddressImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
 69  
         @JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false)
 70  
         protected List<KimEntityAddress> addresses = new TypedArrayList(KimEntityAddressImpl.class);
 71  
         
 72  
         /**
 73  
          * @see org.kuali.rice.kim.bo.entity.KimEntityEntityType#getAddresses()
 74  
          */
 75  
         public List<KimEntityAddress> getAddresses() {
 76  0
                 return addresses;
 77  
         }
 78  
 
 79  
         /**
 80  
          * @see org.kuali.rice.kim.bo.entity.KimEntityEntityType#getEmailAddresses()
 81  
          */
 82  
         public List<KimEntityEmail> getEmailAddresses() {
 83  0
                 return emailAddresses;
 84  
         }
 85  
 
 86  
         /**
 87  
          * @see org.kuali.rice.kim.bo.entity.KimEntityEntityType#getPhoneNumbers()
 88  
          */
 89  
         public List<KimEntityPhone> getPhoneNumbers() {
 90  0
                 return phoneNumbers;
 91  
         }
 92  
 
 93  
         /**
 94  
          * @see org.kuali.rice.kim.bo.entity.KimEntityEntityType#getEntityType()
 95  
          */
 96  
         public EntityType getEntityType() {
 97  0
                 return entityType;
 98  
         }
 99  
 
 100  
         /**
 101  
          * @see org.kuali.rice.kim.bo.entity.KimEntityEntityType#getEntityTypeCode()
 102  
          */
 103  
         public String getEntityTypeCode() {
 104  0
                 return entityTypeCode;
 105  
         }
 106  
 
 107  
         /**
 108  
          * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
 109  
          */
 110  
         @SuppressWarnings("unchecked")
 111  
         @Override
 112  
         protected LinkedHashMap toStringMapper() {
 113  0
                 LinkedHashMap m = new LinkedHashMap();
 114  0
                 m.put( "entityId", entityId );
 115  0
                 m.put( "entityTypeCode", entityTypeCode );
 116  0
                 m.put( "active", active );
 117  0
                 return m;
 118  
         }
 119  
 
 120  
         public String getEntityId() {
 121  0
                 return this.entityId;
 122  
         }
 123  
 
 124  
         public void setEntityId(String entityId) {
 125  0
                 this.entityId = entityId;
 126  0
         }
 127  
 
 128  
         public void setEntityType(EntityType entityType) {
 129  0
                 this.entityType = entityType;
 130  0
         }
 131  
 
 132  
         public void setEntityTypeCode(String entityTypeCode) {
 133  0
                 this.entityTypeCode = entityTypeCode;
 134  0
         }
 135  
 
 136  
         public void setEmailAddresses(List<KimEntityEmail> entityEmailAddresses) {
 137  0
                 this.emailAddresses = entityEmailAddresses;
 138  0
         }
 139  
 
 140  
         public void setPhoneNumbers(List<KimEntityPhone> entityPhoneNumbers) {
 141  0
                 this.phoneNumbers = entityPhoneNumbers;
 142  0
         }
 143  
 
 144  
         public void setAddresses(List<KimEntityAddress> entityAddresses) {
 145  0
                 this.addresses = entityAddresses;
 146  0
         }
 147  
         
 148  
         /**
 149  
          * @see org.kuali.rice.kim.bo.entity.KimEntityEntityType#getDefaultAddress()
 150  
          */
 151  
         public KimEntityAddress getDefaultAddress() {
 152  0
                 return (KimEntityAddress)getDefaultItem( addresses );
 153  
         }
 154  
         
 155  
         /**
 156  
          * This overridden method ...
 157  
          * 
 158  
          * @see org.kuali.rice.kim.bo.entity.KimEntityEntityType#getDefaultEmailAddress()
 159  
          */
 160  
         public KimEntityEmail getDefaultEmailAddress() {
 161  0
                 return (KimEntityEmail)getDefaultItem( emailAddresses );
 162  
         }
 163  
         
 164  
         /**
 165  
          * This overridden method ...
 166  
          * 
 167  
          * @see org.kuali.rice.kim.bo.entity.KimEntityEntityType#getDefaultPhoneNumber()
 168  
          */
 169  
         public KimEntityPhone getDefaultPhoneNumber() {
 170  0
                 return (KimEntityPhone)getDefaultItem( phoneNumbers );
 171  
         }
 172  
 }