View Javadoc
1   /*
2    * Copyright 2006-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.DataObjectBase;
19  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
20  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
21  
22  import javax.persistence.CascadeType;
23  import javax.persistence.Column;
24  import javax.persistence.Entity;
25  import javax.persistence.FetchType;
26  import javax.persistence.GeneratedValue;
27  import javax.persistence.Id;
28  import javax.persistence.JoinColumn;
29  import javax.persistence.ManyToOne;
30  import javax.persistence.Table;
31  
32  @Entity
33  @Table(name = "TRV_ACCT")
34  public class AccountNonUpdatableFK extends DataObjectBase {
35      private static final long serialVersionUID = 1L;
36  
37      @Id
38      @GeneratedValue(generator = "KRTST_GENERATED_PK_S")
39      @PortableSequenceGenerator(name = "KRTST_GENERATED_PK_S")
40      @Column(name="acct_num")
41  	private String number;
42  
43  	@Column(name="acct_name")
44      private String name;
45  
46  	@Column(name="acct_fo_id", insertable = false, updatable = false)
47      private Long accountManagerId;
48  
49  	@ManyToOne(cascade = CascadeType.ALL)
50  	@JoinColumn(name="acct_fo_id")
51      private AccountManagerGeneratedPK accountManager;
52  
53      public String getNumber() {
54          return number;
55      }
56  
57      public void setNumber(String number) {
58          this.number = number;
59      }
60  
61      public String getName() {
62          return name;
63      }
64  
65      public void setName(String name) {
66          this.name = name;
67      }
68  
69      public Long getAccountManagerId() {
70          return accountManagerId;
71      }
72  
73      public void setAccountManagerId(Long accountManagerId) {
74          this.accountManagerId = accountManagerId;
75      }
76  
77      public AccountManagerGeneratedPK getAccountManager() {
78          return accountManager;
79      }
80  
81      public void setAccountManager(AccountManagerGeneratedPK accountManager) {
82          this.accountManager = accountManager;
83      }
84  
85  }