com.hudson.hibernatesynchronizer.mapping
Class HibernateClassProperty

java.lang.Object
  extended bycom.hudson.hibernatesynchronizer.mapping.BaseElement
      extended bycom.hudson.hibernatesynchronizer.mapping.HibernateClassProperty
All Implemented Interfaces:
java.lang.Comparable, IHibernateClassProperty
Direct Known Subclasses:
HibernateClassCollectionProperty

public class HibernateClassProperty
extends BaseElement
implements java.lang.Comparable, IHibernateClassProperty

Author:
Joe Hudson This represents data related to the 'property' node of the 'class' node in the hibernate mapping configuration file.

Field Summary
protected  boolean alternateKey
           
protected  java.lang.String column
           
protected  java.lang.Integer length
           
protected  java.lang.String name
           
protected  boolean notNull
           
protected  HibernateClass parent
           
protected  boolean primaryKey
           
protected  java.lang.String type
           
static int TYPE_COLLECTION
           
static int TYPE_MANY_TO_ONE
           
static int TYPE_ONE_TO_ONE
           
static int TYPE_PROPERTY
           
 
Fields inherited from interface com.hudson.hibernatesynchronizer.mapping.IHibernateClassProperty
LABEL_METADATA
 
Constructor Summary
HibernateClassProperty(HibernateClass parent, org.w3c.dom.Node node)
          Constructor for standard property
HibernateClassProperty(HibernateClass parent, org.w3c.dom.Node node, boolean validate)
          Constructor for standard property (validating optional)
HibernateClassProperty(HibernateClass parent, org.w3c.dom.Node node, int refType, java.lang.String packageName)
          Constructor for many-to-one property
HibernateClassProperty(HibernateClass parent, org.w3c.dom.Node node, int refType, java.lang.String packageName, boolean validate, boolean primaryKey)
          Constructor
 
Method Summary
 int compareTo(java.lang.Object arg0)
          Compare this to another object
 java.lang.String getAbsoluteClassName()
          Return the fully qualified class name that represents this property
 java.lang.String getAbsoluteSignatureClassName()
          Return the fully qualified signature of the class representing this property (or the actual class if it is not a proxy)
 java.lang.String getClassName()
          Return the name of the class without the the package prefix that represents this property
 java.lang.String getColumn()
          Return the column name that this property represents
 java.lang.String getFinderMethod()
          Return the name of a finder method to create in the DAO
 HibernateClass getForeignParent()
          Return the HibernateClass representing the parent to the foreign key relationship or null if N/A
 java.lang.String getGetterName()
          Return the getter name (without the parenthesis) for this property
 java.lang.String getLabel()
          Return a descriptive label based on the property name or the label meta attribute if exists
 java.lang.Integer getLength()
           
 java.lang.String getName()
          Return the defined property name for this property
 java.lang.String getObjectClass()
          Return the object class representation for this class
 java.lang.String getPackage()
          Return the package prefix for this property class without the class name
 HibernateClass getParent()
          Return the parent class for this property
 java.lang.String getPropName()
          Return the actual property name for this property (first letter upper case)
protected  java.lang.String[] getReservedProperties()
          Return the reserved properties associated with this element
 java.lang.String getScopeField()
          Return the field scope
 java.lang.String getScopeGet()
          Return the "getter" scope
 java.lang.String getScopeSet()
          Return the "setter" scope
 java.lang.String getSetterName()
          Return the setter name (without the parenthesis) for this property
 java.lang.String getSignatureClassName()
          Return the name of the class representing this property (or the actual class if it is not a proxy)
 java.lang.String getStaticName()
          Return the static name for this property
 java.lang.String getType()
          Return the value that was specified as the "type" attribute for this property
 java.lang.String getVarName()
          Return the name used as the Java variable name for this property (first letter lower case)
 boolean isAlternateKey()
           
 boolean isManyToOne()
          Return true if this property is a many-to-one and false otherwise
 boolean isOneToOne()
          Return true if this property is a many-to-one and false otherwise
 boolean isPrimaryKey()
           
 boolean isPrimitive()
          Return true if the type of this property represents a primitive
 boolean isRequired()
          Return true if this property can not be null and false otherwise
 boolean isUserType()
          Return true if this property can be determined as an user type and false if not
 void setAlternateKey(boolean isAlternateKey)
           
 void setLength(java.lang.Integer length)
           
 
Methods inherited from class com.hudson.hibernatesynchronizer.mapping.BaseElement
clear, get, get, getCustomProperties, getJavaDoc, getJavaDoc, getMetaData, getNode, getNodeText, getParentRoot, saveMetaData, set, setNode, setParentRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hudson.hibernatesynchronizer.mapping.IHibernateClassProperty
getMetaData
 

Field Detail

TYPE_PROPERTY

public static final int TYPE_PROPERTY
See Also:
Constant Field Values

TYPE_MANY_TO_ONE

public static final int TYPE_MANY_TO_ONE
See Also:
Constant Field Values

TYPE_ONE_TO_ONE

public static final int TYPE_ONE_TO_ONE
See Also:
Constant Field Values

TYPE_COLLECTION

public static final int TYPE_COLLECTION
See Also:
Constant Field Values

parent

protected HibernateClass parent

name

protected java.lang.String name

type

protected java.lang.String type

column

protected java.lang.String column

notNull

protected boolean notNull

alternateKey

protected boolean alternateKey

primaryKey

protected boolean primaryKey

length

protected java.lang.Integer length
Constructor Detail

HibernateClassProperty

public HibernateClassProperty(HibernateClass parent,
                              org.w3c.dom.Node node)
                       throws com.hudson.hibernatesynchronizer.exceptions.TransientPropertyException
Constructor for standard property

Parameters:
parent - the HibernateClass this property belongs to
node - the XML node
Throws:
com.hudson.hibernatesynchronizer.exceptions.TransientPropertyException

HibernateClassProperty

public HibernateClassProperty(HibernateClass parent,
                              org.w3c.dom.Node node,
                              boolean validate)
                       throws com.hudson.hibernatesynchronizer.exceptions.TransientPropertyException
Constructor for standard property (validating optional)

Parameters:
parent - the HibernateClass this property belongs to
node - the XML node
validate -
Throws:
com.hudson.hibernatesynchronizer.exceptions.TransientPropertyException

HibernateClassProperty

public HibernateClassProperty(HibernateClass parent,
                              org.w3c.dom.Node node,
                              int refType,
                              java.lang.String packageName)
                       throws com.hudson.hibernatesynchronizer.exceptions.TransientPropertyException
Constructor for many-to-one property

Parameters:
parent - the HibernateClass this property belongs to
node - the XML node
refType - the relational type
packageName - the package for the relational class
Throws:
com.hudson.hibernatesynchronizer.exceptions.TransientPropertyException

HibernateClassProperty

public HibernateClassProperty(HibernateClass parent,
                              org.w3c.dom.Node node,
                              int refType,
                              java.lang.String packageName,
                              boolean validate,
                              boolean primaryKey)
                       throws com.hudson.hibernatesynchronizer.exceptions.TransientPropertyException
Constructor

Parameters:
parent - the HibernateClass this property belongs to
node - the XML node
refType - the relational type
packageName - the package for the relational class
validate -
primaryKey -
Throws:
com.hudson.hibernatesynchronizer.exceptions.TransientPropertyException
Method Detail

getColumn

public java.lang.String getColumn()
Return the column name that this property represents

Specified by:
getColumn in interface IHibernateClassProperty
Returns:
the column name

getName

public java.lang.String getName()
Return the defined property name for this property

Specified by:
getName in interface IHibernateClassProperty

getLabel

public java.lang.String getLabel()
Return a descriptive label based on the property name or the label meta attribute if exists

Specified by:
getLabel in interface IHibernateClassProperty

getPropName

public java.lang.String getPropName()
Return the actual property name for this property (first letter upper case)

Specified by:
getPropName in interface IHibernateClassProperty

getGetterName

public java.lang.String getGetterName()
Return the getter name (without the parenthesis) for this property

Specified by:
getGetterName in interface IHibernateClassProperty
Returns:
the getter name

getSetterName

public java.lang.String getSetterName()
Return the setter name (without the parenthesis) for this property

Specified by:
getSetterName in interface IHibernateClassProperty
Returns:
the setter name

getVarName

public java.lang.String getVarName()
Return the name used as the Java variable name for this property (first letter lower case)

Specified by:
getVarName in interface IHibernateClassProperty
Returns:
the Java variable name

getType

public java.lang.String getType()
Return the value that was specified as the "type" attribute for this property

Returns:
the type attribute

getAbsoluteSignatureClassName

public java.lang.String getAbsoluteSignatureClassName()
Return the fully qualified signature of the class representing this property (or the actual class if it is not a proxy)

Specified by:
getAbsoluteSignatureClassName in interface IHibernateClassProperty

getSignatureClassName

public java.lang.String getSignatureClassName()
Return the name of the class representing this property (or the actual class if it is not a proxy)

Specified by:
getSignatureClassName in interface IHibernateClassProperty
Returns:

getAbsoluteClassName

public java.lang.String getAbsoluteClassName()
Return the fully qualified class name that represents this property

Specified by:
getAbsoluteClassName in interface IHibernateClassProperty

getClassName

public java.lang.String getClassName()
Return the name of the class without the the package prefix that represents this property

Specified by:
getClassName in interface IHibernateClassProperty

getPackage

public java.lang.String getPackage()
Return the package prefix for this property class without the class name

Specified by:
getPackage in interface IHibernateClassProperty

getParent

public HibernateClass getParent()
Return the parent class for this property

Specified by:
getParent in interface IHibernateClassProperty
Returns:
the parent HibernateClass

isUserType

public boolean isUserType()
Return true if this property can be determined as an user type and false if not


isRequired

public boolean isRequired()
Return true if this property can not be null and false otherwise


isAlternateKey

public boolean isAlternateKey()
Returns:

isPrimaryKey

public boolean isPrimaryKey()

setAlternateKey

public void setAlternateKey(boolean isAlternateKey)
Parameters:
isAlternateKey -

isManyToOne

public boolean isManyToOne()
Return true if this property is a many-to-one and false otherwise


isOneToOne

public boolean isOneToOne()
Return true if this property is a many-to-one and false otherwise


isPrimitive

public boolean isPrimitive()
Return true if the type of this property represents a primitive

Specified by:
isPrimitive in interface IHibernateClassProperty

getObjectClass

public java.lang.String getObjectClass()
Return the object class representation for this class

Specified by:
getObjectClass in interface IHibernateClassProperty

getLength

public java.lang.Integer getLength()
Returns:
Returns the length.

setLength

public void setLength(java.lang.Integer length)
Parameters:
length - The length to set.

getStaticName

public java.lang.String getStaticName()
Return the static name for this property

Specified by:
getStaticName in interface IHibernateClassProperty
Returns:

getForeignParent

public HibernateClass getForeignParent()
Return the HibernateClass representing the parent to the foreign key relationship or null if N/A


getScopeGet

public java.lang.String getScopeGet()
Return the "getter" scope


getScopeSet

public java.lang.String getScopeSet()
Return the "setter" scope


getScopeField

public java.lang.String getScopeField()
Return the field scope


getFinderMethod

public java.lang.String getFinderMethod()
Return the name of a finder method to create in the DAO


getReservedProperties

protected java.lang.String[] getReservedProperties()
Return the reserved properties associated with this element

Overrides:
getReservedProperties in class BaseElement

compareTo

public int compareTo(java.lang.Object arg0)
Compare this to another object

Specified by:
compareTo in interface java.lang.Comparable