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.test.document.bo;
17  
18  import org.kuali.rice.krad.bo.PersistableBusinessObjectExtensionBase;
19  import org.kuali.rice.krad.data.provider.annotation.ExtensionFor;
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.OneToOne;
29  import javax.persistence.Table;
30  
31  @Entity
32  @Table(name="TRV_ACCT_EXT")
33  @ExtensionFor(Account.class)
34  public class AccountExtension extends PersistableBusinessObjectExtensionBase {
35  
36      private static final long serialVersionUID = -3231626970774119782L;
37  
38      @Id
39      @OneToOne
40      @JoinColumn(name = "ACCT_NUM")
41  	private Account account;
42  
43  	@Column(name = "ACCT_TYPE")
44      private String accountTypeCode;
45  
46  	@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.DETACH,CascadeType.REFRESH})
47  	@JoinColumn(name = "ACCT_TYPE", insertable=false, updatable=false)
48      private AccountType accountType;
49  
50      @Column(name = "ACCT_NUM", insertable = false, updatable = false)
51      private String number;
52  
53      public Account getAccount() {
54          return account;
55      }
56  
57      public void setAccount(Account account) {
58          this.account = account;
59      }
60  
61      public String getAccountTypeCode() {
62          return accountTypeCode;
63      }
64  
65      public void setAccountTypeCode(String accountTypeCode) {
66          this.accountTypeCode = accountTypeCode;
67      }
68  
69  	public AccountType getAccountType() {
70  		return accountType;
71  	}
72  
73  	public void setAccountType(AccountType accountType) {
74  		this.accountType = accountType;
75  	}
76  
77      public String getNumber() {
78          return number;
79      }
80  
81      public void setNumber(String number) {
82          this.number = number;
83      }
84  }