001/** 002 * Copyright 2005-2015 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.krad.labs; 017 018 019import org.kuali.rice.core.api.util.type.KualiPercent; 020import org.kuali.rice.kim.api.identity.Person; 021import org.kuali.rice.kim.api.services.KimApiServiceLocator; 022import org.kuali.rice.krad.bo.DataObjectBase; 023import org.kuali.rice.krad.bo.PersistableAttachmentList; 024import org.kuali.rice.krad.data.provider.annotation.Description; 025import org.kuali.rice.krad.data.provider.annotation.ForceUppercase; 026import org.kuali.rice.krad.data.provider.annotation.InheritProperties; 027import org.kuali.rice.krad.data.provider.annotation.InheritProperty; 028import org.kuali.rice.krad.data.provider.annotation.KeyValuesFinderClass; 029import org.kuali.rice.krad.data.provider.annotation.Label; 030import org.kuali.rice.krad.data.provider.annotation.Relationship; 031import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType; 032import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews; 033import org.kuali.rice.krad.data.provider.annotation.UifDisplayHint; 034import org.kuali.rice.krad.data.provider.annotation.UifDisplayHintType; 035import org.kuali.rice.krad.data.provider.annotation.UifDisplayHints; 036import org.kuali.rice.krad.data.provider.annotation.UifValidCharactersConstraintBeanName; 037import org.kuali.rice.krad.demo.travel.dataobject.TravelAccountType; 038import org.kuali.rice.krad.demo.travel.dataobject.TravelSubAccount; 039import org.kuali.rice.krad.demo.travel.options.AccountTypeKeyValues; 040 041import javax.persistence.CascadeType; 042import javax.persistence.Column; 043import javax.persistence.Entity; 044import javax.persistence.FetchType; 045import javax.persistence.Id; 046import javax.persistence.ManyToOne; 047import javax.persistence.OneToMany; 048import javax.persistence.PrimaryKeyJoinColumn; 049import javax.persistence.Table; 050import javax.persistence.Temporal; 051import javax.persistence.TemporalType; 052import javax.persistence.Transient; 053import javax.validation.constraints.Size; 054import java.io.Serializable; 055import java.util.ArrayList; 056import java.util.Date; 057import java.util.List; 058 059@Entity 060@Table(name="TRV_ATT_GRP_SAMPLE") 061@UifAutoCreateViews({UifAutoCreateViewType.LOOKUP}) 062public class LabsTravelAttachmentGroup extends DataObjectBase implements PersistableAttachmentList<LabsTravelAttachment> 063 ,Serializable { 064 private static final long serialVersionUID = -7739303391609395867L; 065 066 @Id 067 @Column(name="ATT_GRP_NUM",length=10) 068 @Label("Attachment Group Number") 069 @Description("Unique identifier for account") 070 @UifValidCharactersConstraintBeanName("AlphaNumericPatternConstraint") 071 private String number; 072 073 @Column(name="ATT_GRP_NAME",length=40) 074 @Label("Attachment Group Name") 075 private String name; 076 077 @OneToMany(fetch=FetchType.EAGER, orphanRemoval=true, cascade= {CascadeType.ALL}, mappedBy = "labsTravelAttachmentGroup") 078 protected List<LabsTravelAttachment> attachments; 079 080 public String getName() { 081 return name; 082 } 083 084 public void setName(String name) { 085 this.name = name; 086 } 087 088 public String getNumber() { 089 return number; 090 } 091 092 public void setNumber(String number) { 093 this.number = number; 094 } 095 096 public List<LabsTravelAttachment> getAttachments() { 097 if(attachments == null) { 098 attachments = new ArrayList<LabsTravelAttachment>(); 099 } 100 return attachments; 101 } 102 103 public void setAttachments(List<LabsTravelAttachment> attachments) { 104 this.attachments = attachments; 105 } 106 107}