• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 Google, Inc.
3  *
4  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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 
17 package com.google.inject.persist.jpa;
18 
19 import java.util.ArrayList;
20 import java.util.List;
21 import javax.persistence.Entity;
22 import javax.persistence.GeneratedValue;
23 import javax.persistence.Id;
24 import javax.persistence.OneToMany;
25 
26 /**
27  * Created with IntelliJ IDEA. On: 2/06/2007
28  *
29  * @author Dhanji R. Prasanna (dhanji@gmail.com)
30  * @since 1.0
31  */
32 @Entity
33 public class JpaParentTestEntity {
34   private Long id;
35   private List<JpaTestEntity> children = new ArrayList<>();
36 
37   @Id
38   @GeneratedValue
getId()39   public Long getId() {
40     return id;
41   }
42 
setId(Long id)43   public void setId(Long id) {
44     this.id = id;
45   }
46 
47   @OneToMany
getChildren()48   public List<JpaTestEntity> getChildren() {
49     return children;
50   }
51 
setChildren(List<JpaTestEntity> children)52   public void setChildren(List<JpaTestEntity> children) {
53     this.children = children;
54   }
55 }
56