View Javadoc

1   /*
2    * Copyright 2011 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/ecl1.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 javax.persistence.Column;
19  import javax.persistence.Entity;
20  import javax.persistence.Id;
21  import javax.persistence.Table;
22  
23  @Entity
24  @Table(name="KRTST_PARENT_GEN_KEY_CHILD_T")
25  public class ChildOfParentObjectWithGeneratedKey {
26  
27      @Id
28      @Column(name="GENERATED_PK_COL",length=8,precision=0)
29      Long generatedKey;
30  
31      @Id
32      @Column(name="CHILDS_PK_COL",length=8,precision=0)
33      Long childKey;
34  
35      public ChildOfParentObjectWithGeneratedKey() {
36      }
37  
38      public ChildOfParentObjectWithGeneratedKey( Long childKey ) {
39          this.childKey = childKey;
40      }
41  
42      public Long getGeneratedKey() {
43          return this.generatedKey;
44      }
45  
46      public void setGeneratedKey(Long generatedKey) {
47          this.generatedKey = generatedKey;
48      }
49  
50      public Long getChildKey() {
51          return this.childKey;
52      }
53  
54      public void setChildKey(Long childKey) {
55          this.childKey = childKey;
56      }
57  
58      @Override
59      public String toString() {
60          StringBuilder builder = new StringBuilder();
61          builder.append("ChildOfParentObjectWithGeneratedKey [");
62          if (this.generatedKey != null) {
63              builder.append("generatedKey=").append(this.generatedKey).append(", ");
64          }
65          if (this.childKey != null) {
66              builder.append("childKey=").append(this.childKey);
67          }
68          builder.append("]");
69          return builder.toString();
70      }
71  }