01: // $Id: VersionProperty.java 10119 2006-07-14 00:09:19Z steve.ebersole@jboss.com $
02: package org.hibernate.tuple;
03:
04: import org.hibernate.engine.CascadeStyle;
05: import org.hibernate.engine.VersionValue;
06: import org.hibernate.type.Type;
07:
08: /**
09: * Represents a version property within the Hibernate runtime-metamodel.
10: *
11: * @author Steve Ebersole
12: */
13: public class VersionProperty extends StandardProperty {
14:
15: private final VersionValue unsavedValue;
16:
17: /**
18: * Constructs VersionProperty instances.
19: *
20: * @param name The name by which the property can be referenced within
21: * its owner.
22: * @param node The node name to use for XML-based representation of this
23: * property.
24: * @param type The Hibernate Type of this property.
25: * @param lazy Should this property be handled lazily?
26: * @param insertable Is this property an insertable value?
27: * @param updateable Is this property an updateable value?
28: * @param insertGenerated Is this property generated in the database on insert?
29: * @param updateGenerated Is this property generated in the database on update?
30: * @param nullable Is this property a nullable value?
31: * @param checkable Is this property a checkable value?
32: * @param versionable Is this property a versionable value?
33: * @param cascadeStyle The cascade style for this property's value.
34: * @param unsavedValue The value which, if found as the value of
35: * this (i.e., the version) property, represents new (i.e., un-saved)
36: * instances of the owning entity.
37: */
38: public VersionProperty(String name, String node, Type type,
39: boolean lazy, boolean insertable, boolean updateable,
40: boolean insertGenerated, boolean updateGenerated,
41: boolean nullable, boolean checkable, boolean versionable,
42: CascadeStyle cascadeStyle, VersionValue unsavedValue) {
43: super (name, node, type, lazy, insertable, updateable,
44: insertGenerated, updateGenerated, nullable, checkable,
45: versionable, cascadeStyle, null);
46: this .unsavedValue = unsavedValue;
47: }
48:
49: public VersionValue getUnsavedValue() {
50: return unsavedValue;
51: }
52: }
|