KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > persistence > entitygenerator > RelationshipRole


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.j2ee.persistence.entitygenerator;
20
21 /**
22  * Abstract information about role in a relationship between 2 entity classes
23  * (either CMP or Java Persistence API).
24  *
25  * @author Chris Webster, Pavel Buzek
26  */

27 public class RelationshipRole {
28     
29     private String JavaDoc roleName;
30     private String JavaDoc entityName;
31     private String JavaDoc fieldName;
32     private boolean many;
33     private boolean toMany;
34     private boolean cascade;
35     
36     private EntityRelation parent;
37  
38     public RelationshipRole (String JavaDoc roleName,
39             String JavaDoc entityName,
40             String JavaDoc fieldName,
41             boolean many,
42             boolean toMany,
43             boolean cascade) {
44         this.setRoleName(roleName);
45         this.setEntityName(entityName);
46         this.setFieldName(fieldName);
47         this.setMany(many);
48         this.setToMany(toMany);
49         this.setCascade(cascade);
50     }
51     
52     public RelationshipRole (EntityRelation parentRelation) {
53         setParent(parentRelation);
54     }
55     
56     public String JavaDoc getRoleName() {
57         return roleName;
58     }
59
60     public void setRoleName(String JavaDoc roleName) {
61         this.roleName = roleName;
62     }
63
64     public String JavaDoc getEntityName() {
65         return entityName;
66     }
67
68     public void setEntityName(String JavaDoc entityName) {
69         this.entityName = entityName;
70     }
71
72     public String JavaDoc getFieldName() {
73         return fieldName;
74     }
75
76     public void setFieldName(String JavaDoc fieldName) {
77         this.fieldName = fieldName;
78     }
79
80     public boolean isMany() {
81         return many;
82     }
83
84     public void setMany(boolean many) {
85         this.many = many;
86     }
87
88     public boolean isToMany() {
89         return toMany;
90     }
91
92     public void setToMany(boolean toMany) {
93         this.toMany = toMany;
94     }
95
96     public boolean isCascade() {
97         return cascade;
98     }
99
100     public void setCascade(boolean cascade) {
101         this.cascade = cascade;
102     }
103
104     public EntityRelation getParent() {
105         return parent;
106     }
107
108     public void setParent(EntityRelation parent) {
109         this.parent = parent;
110     }
111
112 }
113
Popular Tags