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.demo.travel.dataobject;
17  
18  import org.kuali.rice.krad.bo.DataObjectBase;
19  import org.kuali.rice.krad.data.provider.annotation.ForceUppercase;
20  import org.kuali.rice.krad.data.provider.annotation.Label;
21  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType;
22  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews;
23  
24  import javax.persistence.Column;
25  import javax.persistence.Entity;
26  import javax.persistence.Id;
27  import javax.persistence.JoinColumn;
28  import javax.persistence.ManyToOne;
29  import javax.persistence.Table;
30  import javax.validation.constraints.NotNull;
31  
32  @Entity
33  @Table(name="TRV_SUB_ACCT")
34  @UifAutoCreateViews({UifAutoCreateViewType.INQUIRY,UifAutoCreateViewType.LOOKUP})
35  public class TravelSubAccount extends DataObjectBase {
36  
37  	private static final long serialVersionUID = 5768156680246084251L;
38  
39      @Id
40      @Column(name = "ACCT_NUM",length = 10)
41      @Label("Travel Account Number")
42      @NotNull
43      private String travelAccountNumber;
44  
45  	@Id
46      @ForceUppercase
47  	@Column(name="SUB_ACCT",length=10)
48  	@Label("Travel Sub Account Number")
49      @NotNull
50  	private String subAccount;
51  
52  	@Column(name="SUB_ACCT_NAME",length=40)
53      @NotNull
54  	private String subAccountName;
55  
56      @ManyToOne
57      @JoinColumn(name = "ACCT_NUM" ,insertable=false, updatable=false)
58      TravelAccount account;
59  
60      public String getTravelAccountNumber() {
61          return this.travelAccountNumber;
62      }
63  
64      public void setTravelAccountNumber(String travelAccountNumber) {
65          this.travelAccountNumber = travelAccountNumber;
66      }
67  
68      public String getSubAccount() {
69          return this.subAccount;
70      }
71  
72      public void setSubAccount(String subAccount) {
73          this.subAccount = subAccount;
74      }
75  
76      public String getSubAccountName() {
77          return this.subAccountName;
78      }
79  
80      public void setSubAccountName(String subAccountName) {
81          this.subAccountName = subAccountName;
82      }
83  
84      public TravelAccount getAccount() {
85          return this.account;
86      }
87  
88      public void setAccount(TravelAccount account) {
89          this.account = account;
90      }
91  }