KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > structure > model > Relationship


1 package com.dotmarketing.portlets.structure.model;
2
3 import com.dotmarketing.beans.Inode;
4 import com.dotmarketing.factories.InodeFactory;
5
6
7
8 public class Relationship extends Inode
9 {
10     
11     private static final long serialVersionUID = 1L;
12     
13     private long parentStructureInode;
14     private long childStructureInode;
15     private String JavaDoc parentRelationName;
16     private String JavaDoc childRelationName;
17     private String JavaDoc relationTypeValue;
18     private int cardinality;
19     private boolean parentRequired;
20     private boolean childRequired;
21     
22     
23     
24     public Relationship(){
25         super.setType("relationship");
26     }
27     
28     
29     /**
30      * @return Returns the cardinality.
31      */

32     public int getCardinality() {
33         return cardinality;
34     }
35     /**
36      * @param cardinality The cardinality to set.
37      */

38     public void setCardinality(int cardinality) {
39         this.cardinality = cardinality;
40     }
41     /**
42      * @return Returns the childRelationName.
43      */

44     public String JavaDoc getChildRelationName() {
45         return childRelationName;
46     }
47     /**
48      * @param childRelationName The childRelationName to set.
49      */

50     public void setChildRelationName(String JavaDoc childRelationName) {
51         this.childRelationName = childRelationName;
52     }
53     /**
54      * @return Returns the childStructureInode.
55      */

56     public long getChildStructureInode() {
57         return childStructureInode;
58     }
59     
60     public Structure getChildStructure () {
61         return (Structure) InodeFactory.getInode(childStructureInode, Structure.class);
62     }
63     
64     /**
65      * @param childStructureInode The childStructureInode to set.
66      */

67     public void setChildStructureInode(long childStructureInode) {
68         this.childStructureInode = childStructureInode;
69     }
70     /**
71      * @return Returns the parentRelationName.
72      */

73     public String JavaDoc getParentRelationName() {
74         return parentRelationName;
75     }
76     /**
77      * @param parentRelationName The parentRelationName to set.
78      */

79     public void setParentRelationName(String JavaDoc parentRelationName) {
80         this.parentRelationName = parentRelationName;
81     }
82
83     public Structure getParentStructure () {
84         return (Structure) InodeFactory.getInode(parentStructureInode, Structure.class);
85     }
86     
87     /**
88      * @return Returns the parentStructureInode.
89      */

90     public long getParentStructureInode() {
91         return parentStructureInode;
92     }
93     /**
94      * @param parentStructureInode The parentStructureInode to set.
95      */

96     public void setParentStructureInode(long parentStructureInode) {
97         this.parentStructureInode = parentStructureInode;
98     }
99     /**
100      * @return Returns the relationTypeValue.
101      */

102     public String JavaDoc getRelationTypeValue() {
103         return relationTypeValue;
104     }
105     /**
106      * @param relationTypeValue The relationTypeValue to set.
107      */

108     public void setRelationTypeValue(String JavaDoc relationTypeValue) {
109         this.relationTypeValue = relationTypeValue;
110     }
111     public boolean isChildRequired() {
112         return childRequired;
113     }
114     public void setChildRequired(boolean childRequired) {
115         this.childRequired = childRequired;
116     }
117     public boolean isParentRequired() {
118         return parentRequired;
119     }
120     public void setParentRequired(boolean parentRequired) {
121         this.parentRequired = parentRequired;
122     }
123
124     
125 }
126
Popular Tags