001/** 002 * Copyright 2005-2014 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.test.document.bo; 017 018import org.kuali.rice.krad.bo.PersistableBusinessObjectExtensionBase; 019import org.kuali.rice.krad.data.provider.annotation.ExtensionFor; 020 021import javax.persistence.CascadeType; 022import javax.persistence.Column; 023import javax.persistence.Entity; 024import javax.persistence.FetchType; 025import javax.persistence.Id; 026import javax.persistence.JoinColumn; 027import javax.persistence.ManyToOne; 028import javax.persistence.OneToOne; 029import javax.persistence.Table; 030 031@Entity 032@Table(name="TRV_ACCT_EXT") 033@ExtensionFor(Account.class) 034public class AccountExtension extends PersistableBusinessObjectExtensionBase { 035 036 private static final long serialVersionUID = -3231626970774119782L; 037 038 @Id 039 @OneToOne 040 @JoinColumn(name = "ACCT_NUM") 041 private Account account; 042 043 @Column(name = "ACCT_TYPE") 044 private String accountTypeCode; 045 046 @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.DETACH,CascadeType.REFRESH}) 047 @JoinColumn(name = "ACCT_TYPE", insertable=false, updatable=false) 048 private AccountType accountType; 049 050 @Column(name = "ACCT_NUM", insertable = false, updatable = false) 051 private String number; 052 053 public Account getAccount() { 054 return account; 055 } 056 057 public void setAccount(Account account) { 058 this.account = account; 059 } 060 061 public String getAccountTypeCode() { 062 return accountTypeCode; 063 } 064 065 public void setAccountTypeCode(String accountTypeCode) { 066 this.accountTypeCode = accountTypeCode; 067 } 068 069 public AccountType getAccountType() { 070 return accountType; 071 } 072 073 public void setAccountType(AccountType accountType) { 074 this.accountType = accountType; 075 } 076 077 public String getNumber() { 078 return number; 079 } 080 081 public void setNumber(String number) { 082 this.number = number; 083 } 084}