001/** 002 * Copyright 2005-2018 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.demo.travel.dataobject; 017 018import org.kuali.rice.krad.bo.DataObjectBase; 019import org.kuali.rice.krad.data.provider.annotation.ForceUppercase; 020import org.kuali.rice.krad.data.provider.annotation.Label; 021import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType; 022import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews; 023 024import javax.persistence.Column; 025import javax.persistence.Entity; 026import javax.persistence.Id; 027import javax.persistence.JoinColumn; 028import javax.persistence.ManyToOne; 029import javax.persistence.Table; 030import javax.validation.constraints.NotNull; 031 032@Entity 033@Table(name="TRV_SUB_ACCT") 034@UifAutoCreateViews({UifAutoCreateViewType.INQUIRY,UifAutoCreateViewType.LOOKUP}) 035public class TravelSubAccount extends DataObjectBase { 036 037 private static final long serialVersionUID = 5768156680246084251L; 038 039 @Id 040 @Column(name = "ACCT_NUM",length = 10) 041 @Label("Travel Account Number") 042 @NotNull 043 private String travelAccountNumber; 044 045 @Id 046 @ForceUppercase 047 @Column(name="SUB_ACCT",length=10) 048 @Label("Travel Sub Account Number") 049 @NotNull 050 private String subAccount; 051 052 @Column(name="SUB_ACCT_NAME",length=40) 053 @NotNull 054 private String subAccountName; 055 056 @ManyToOne 057 @JoinColumn(name = "ACCT_NUM" ,insertable=false, updatable=false) 058 TravelAccount account; 059 060 public String getTravelAccountNumber() { 061 return this.travelAccountNumber; 062 } 063 064 public void setTravelAccountNumber(String travelAccountNumber) { 065 this.travelAccountNumber = travelAccountNumber; 066 } 067 068 public String getSubAccount() { 069 return this.subAccount; 070 } 071 072 public void setSubAccount(String subAccount) { 073 this.subAccount = subAccount; 074 } 075 076 public String getSubAccountName() { 077 return this.subAccountName; 078 } 079 080 public void setSubAccountName(String subAccountName) { 081 this.subAccountName = subAccountName; 082 } 083 084 public TravelAccount getAccount() { 085 return this.account; 086 } 087 088 public void setAccount(TravelAccount account) { 089 this.account = account; 090 } 091}