KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > tuple > StandardProperty


1 // $Id: StandardProperty.java,v 1.5 2005/06/05 04:31:34 oneovthafew Exp $
2
package org.hibernate.tuple;
3
4 import org.hibernate.engine.CascadeStyle;
5 import org.hibernate.type.Type;
6
7 /**
8  * Represents a basic property within the Hibernate runtime-metamodel.
9  *
10  * @author Steve Ebersole
11  */

12 public class StandardProperty extends Property {
13
14     private boolean lazy;
15     private boolean insertable;
16     private boolean updateable;
17     private boolean nullable;
18     private boolean dirtyCheckable;
19     private boolean versionable;
20     private CascadeStyle cascadeStyle;
21
22     /**
23      * Constructs StandardProperty instances.
24      *
25      * @param name The name by which the property can be referenced within
26      * its owner.
27      * @param node The node name to use for XML-based representation of this
28      * property.
29      * @param type The Hibernate Type of this property.
30      * @param lazy Should this property be handled lazily?
31      * @param insertable Is this property an insertable value?
32      * @param updateable Is this property an updateable value?
33      * @param nullable Is this property a nullable value?
34      * @param checkable Is this property a checkable value?
35      * @param versionable Is this property a versionable value?
36      * @param cascadeStyle The cascade style for this property's value.
37      */

38     public StandardProperty(
39             String JavaDoc name,
40             String JavaDoc node,
41             Type type,
42             boolean lazy,
43             boolean insertable,
44             boolean updateable,
45             boolean nullable,
46             boolean checkable,
47             boolean versionable,
48             CascadeStyle cascadeStyle) {
49         super(name, node, type);
50         this.lazy = lazy;
51         this.insertable = insertable;
52         this.updateable = updateable;
53         this.nullable = nullable;
54         this.dirtyCheckable = checkable;
55         this.versionable = versionable;
56         this.cascadeStyle = cascadeStyle;
57     }
58
59     public boolean isLazy() {
60         return lazy;
61     }
62
63     public void setLazy(boolean lazy) {
64         this.lazy = lazy;
65     }
66
67     public boolean isInsertable() {
68         return insertable;
69     }
70
71     public void setInsertable(boolean insertable) {
72         this.insertable = insertable;
73     }
74
75     public boolean isUpdateable() {
76         return updateable;
77     }
78
79     public void setUpdateable(boolean updateable) {
80         this.updateable = updateable;
81     }
82
83     public boolean isNullable() {
84         return nullable;
85     }
86
87     public void setNullable(boolean nullable) {
88         this.nullable = nullable;
89     }
90
91     public boolean isDirtyCheckable(boolean hasUninitializedProperties) {
92         return isDirtyCheckable() && ( !hasUninitializedProperties || !isLazy() );
93     }
94
95     public boolean isDirtyCheckable() {
96         return dirtyCheckable;
97     }
98
99     public void setDirtyCheckable(boolean checkable) {
100         this.dirtyCheckable = checkable;
101     }
102
103     public boolean isVersionable() {
104         return versionable;
105     }
106
107     public void setVersionable(boolean versionable) {
108         this.versionable = versionable;
109     }
110
111     public CascadeStyle getCascadeStyle() {
112         return cascadeStyle;
113     }
114
115     public void setCascadeStyle(CascadeStyle cascadeStyle) {
116         this.cascadeStyle = cascadeStyle;
117     }
118 }
119
Popular Tags