View Javadoc
1   /**
2    * Copyright 2005-2014 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.krad.labs;
17  
18  
19  import org.kuali.rice.core.api.util.type.KualiPercent;
20  import org.kuali.rice.kim.api.identity.Person;
21  import org.kuali.rice.kim.api.services.KimApiServiceLocator;
22  import org.kuali.rice.krad.bo.DataObjectBase;
23  import org.kuali.rice.krad.bo.PersistableAttachmentList;
24  import org.kuali.rice.krad.data.provider.annotation.Description;
25  import org.kuali.rice.krad.data.provider.annotation.ForceUppercase;
26  import org.kuali.rice.krad.data.provider.annotation.InheritProperties;
27  import org.kuali.rice.krad.data.provider.annotation.InheritProperty;
28  import org.kuali.rice.krad.data.provider.annotation.KeyValuesFinderClass;
29  import org.kuali.rice.krad.data.provider.annotation.Label;
30  import org.kuali.rice.krad.data.provider.annotation.Relationship;
31  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType;
32  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews;
33  import org.kuali.rice.krad.data.provider.annotation.UifDisplayHint;
34  import org.kuali.rice.krad.data.provider.annotation.UifDisplayHintType;
35  import org.kuali.rice.krad.data.provider.annotation.UifDisplayHints;
36  import org.kuali.rice.krad.data.provider.annotation.UifValidCharactersConstraintBeanName;
37  import org.kuali.rice.krad.demo.travel.dataobject.TravelAccountType;
38  import org.kuali.rice.krad.demo.travel.dataobject.TravelSubAccount;
39  import org.kuali.rice.krad.demo.travel.options.AccountTypeKeyValues;
40  
41  import javax.persistence.CascadeType;
42  import javax.persistence.Column;
43  import javax.persistence.Entity;
44  import javax.persistence.FetchType;
45  import javax.persistence.Id;
46  import javax.persistence.ManyToOne;
47  import javax.persistence.OneToMany;
48  import javax.persistence.PrimaryKeyJoinColumn;
49  import javax.persistence.Table;
50  import javax.persistence.Temporal;
51  import javax.persistence.TemporalType;
52  import javax.persistence.Transient;
53  import javax.validation.constraints.Size;
54  import java.io.Serializable;
55  import java.util.ArrayList;
56  import java.util.Date;
57  import java.util.List;
58  
59  @Entity
60  @Table(name="TRV_ATT_GRP_SAMPLE")
61  @UifAutoCreateViews({UifAutoCreateViewType.INQUIRY,UifAutoCreateViewType.LOOKUP})
62  public class LabsTravelAttachmentGroup extends DataObjectBase implements PersistableAttachmentList<LabsTravelAttachment>
63          ,Serializable {
64      private static final long serialVersionUID = -7739303391609395867L;
65  
66      @Id
67      @Column(name="ATT_GRP_NUM",length=10)
68      @Label("Attachment Group Number")
69      @Description("Unique identifier for account")
70      @UifValidCharactersConstraintBeanName("AlphaNumericPatternConstraint")
71      private String number;
72  
73      @Column(name="ATT_GRP_NAME",length=40)
74      @Label("Attachment Group Name")
75      private String name;
76  
77      @OneToMany(fetch=FetchType.EAGER, orphanRemoval=true, cascade= {CascadeType.ALL}, mappedBy = "labsTravelAttachmentGroup")
78      protected List<LabsTravelAttachment> attachments;
79  
80      public String getName() {
81          return name;
82      }
83  
84      public void setName(String name) {
85          this.name = name;
86      }
87  
88      public String getNumber() {
89          return number;
90      }
91  
92      public void setNumber(String number) {
93          this.number = number;
94      }
95  
96      public List<LabsTravelAttachment> getAttachments() {
97          if(attachments == null) {
98              attachments = new ArrayList<LabsTravelAttachment>();
99          }
100         return attachments;
101     }
102 
103     public void setAttachments(List<LabsTravelAttachment> attachments) {
104         this.attachments = attachments;
105     }
106 
107 }