com.hudson.hibernatesynchronizer.mapping
Class HibernateClass

java.lang.Object
  extended bycom.hudson.hibernatesynchronizer.mapping.BaseElement
      extended bycom.hudson.hibernatesynchronizer.mapping.HibernateClass
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
HibernateComponentClass

public class HibernateClass
extends BaseElement
implements java.lang.Comparable


Field Summary
protected  java.lang.String absoluteValueObjectClassName
           
static int TYPE_CLASS
           
static int TYPE_COMPONENT
           
static int TYPE_JOINED_SUBCLASS
           
static int TYPE_SUBCLASS
           
 
Constructor Summary
HibernateClass(org.w3c.dom.Node node, java.lang.String packageName, HibernateClass parent, IProject project, boolean validate, int type, HibernateDocument document)
          Constructor for component
HibernateClass(org.w3c.dom.Node node, java.lang.String packageName, HibernateClass parent, IProject project, HibernateDocument document)
          Constructor for subclass
HibernateClass(org.w3c.dom.Node node, java.lang.String packageName, IProject project, HibernateDocument document)
          Constructor for non-subclass
 
Method Summary
 boolean canSyncCustom()
           
 boolean canSyncDAO()
           
 boolean canSyncValueObject()
           
 int compareTo(java.lang.Object arg0)
          Compare this to another object
 java.lang.String getAbsoluteBaseDAOClassName()
          Return the fully qualified class name of the Base DAO used for the hibernate persistance
 java.lang.String getAbsoluteBaseRootDAOClassName()
          Return the fully qualified class name of the base root DAO class.
 java.lang.String getAbsoluteBaseValueObjectClassName()
          Return the fully qualified class name of the base value object class used for the hibernate persistance
 java.lang.String getAbsoluteDAOClassName()
          Return the fully qualified class name of the DAO used for the hibernate persistance
 java.lang.String getAbsoluteRootDAOClassName()
          Return the fully qualified class name of the root DAO class.
 java.lang.String getAbsoluteValueObjectClassName()
          Return the fully qualified name of the extension class that represents the value object used by hibernate for persistance
 java.lang.String getAbsoluteValueObjectProxyClassName()
          Return the fully qualitifed name of the proxy or null if N/A
 java.lang.String getAbsoluteValueObjectSignatureClassName()
          Return the fully qualified name of the extension class that represents the business object used by hibernate for persistance (or the proxy if exists)
 java.util.Collection getAllProperties()
          Return all the properties of the class but do not include any composite key properties
 java.util.Collection getAllProperties(boolean addCompositeKeyProperties)
          Return all the properties of the class
 java.util.List getAlternateKeys()
          Return a list of properties that relate to the alternate keys (or a 0 length list if N/A)
 java.lang.String getBaseDAOClassName()
          Return the name without the package prefix of the base DAO class used as the SessionFactory wrapper
 java.lang.String getBaseDAOPackage()
          Return the package prefix that relates to the base DAO class used as the wrapper to the SessionFactory access
 java.lang.String getBaseRootDAOClassName()
          Return the class name of the root DAO class without the package prefix.
 java.lang.String getBaseValueObjectClassName()
          Return the name without the package prefix of the base value object class used for the hibernate persistance
 java.lang.String getBaseValueObjectPackage()
          Return the package prefix that relates to the base DAO class used as the wrapper to the SessionFactory access
 java.util.List getCollectionList()
          Return the list of collection objects for this hibernate class
 java.util.List getComponentList()
          Return a list of the components that are defined for this class
 java.lang.String getDAOClassName()
          Return the name without the package prefix of the extension DAO class used as the SessionFactory wrapper
 java.lang.String getDAOPackage()
          Return the package prefix that relates to the extension DAO class used as the wrapper to the SessionFactory access
 HibernateDocument getDocument()
          Return the document that relates to this mapping file
 HibernateClassId getId()
          Return the id object for the given HibernateClass
 HibernateClassId getId(boolean goToParent)
          Return the id object for the given HibernateClass
 java.lang.String getLabel()
          Return a descriptive label based on the class name (or using the 'label' meta override)
 java.util.List getManyToOneList()
          Return the objects that represent many-to-one relationships for the hibernate class
 java.util.List getOneToOneList()
          Return the objects that represent one-to-one relationships for the hibernate class
 HibernateClass getParent()
          Return the parent HibernateClass object if this is a subclass or null if N/A
 HibernateClass getParentRoot()
          Return the root parent of a subclass or this if no subclass
 IProject getProject()
          Return the eclipse project related to the resource
 java.util.List getProperties()
          return the properties that represent the standard columns in the that relating to this hibernate class
 java.util.List getPropertiesWithComponents()
          Return a list of all properties including the properties are hidden inside the components that belong to this class
 IHibernateClassProperty getProperty(java.lang.String propName)
          Return the property matching the property name
 IHibernateClassProperty getPropertyByColName(java.lang.String colName)
          Return the property matching the column name
 java.lang.String getProxyPackage()
          Return the package of the proxy for this class or null if N/A
 java.util.List getQueries()
          Return a list of objects represent the query definitions related to this class.
 java.util.List getRequiredFields()
          Return a list of properties that are required
protected  java.lang.String[] getReservedProperties()
          Return the reserved properties associated with this element
 java.lang.String getRootDAOClassName()
          Return the class name of the root DAO class without the package prefix.
 java.lang.String getRootDAOPackage()
          Return the package prefix of the root DAO class.
 java.util.List getSubclassList()
          Return a list of class that will subclass this hibernate class
 java.lang.String getTableName()
          Return the name of the table that will be used for persistance of this hibernate class
 HibernateClassProperty getTimestamp()
          Return the HibernateClassProperty that relates to the timestamp or null if N/A
 java.lang.String getValueObjectClassName()
          Return the name of the extension class without any package prefix that represents the value object used by hibernate for persistance
 java.lang.String getValueObjectPackage()
          Return the package prefix without the class name of the extension class that represents the value object used by hibernate for persistance
 java.lang.String getValueObjectProxyClassName()
          Return the relative class name of the proxy or null if N/A
 java.lang.String getValueObjectScope()
          Return the class scope of the value object
 java.lang.String getValueObjectSignatureClassName()
          Return the name of the extension class without any package prefix that represents the value object used by hibernate for persistance (or the proxy if exists)
 java.lang.String getVarName()
          Return the variable name related to this class that will be used for the generation
 HibernateClassProperty getVersion()
          Return the HibernateClassProperty that relates to the version or null if N/A
 boolean hasProxy()
          Return true if this class has a proxy and false if not
 boolean isComponent()
           
 boolean isSubclass()
          Return true if this class is a subclass or false if not
 void setQueries(java.util.List queries)
          Set the queries for this class
protected  void setValueObjectClassName(java.lang.String name)
          Set the name of this class
 boolean useCustomDAO()
           
 
Methods inherited from class com.hudson.hibernatesynchronizer.mapping.BaseElement
clear, get, get, getCustomProperties, getJavaDoc, getJavaDoc, getMetaData, getNode, getNodeText, saveMetaData, set, setNode, setParentRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_CLASS

public static final int TYPE_CLASS
See Also:
Constant Field Values

TYPE_SUBCLASS

public static final int TYPE_SUBCLASS
See Also:
Constant Field Values

TYPE_JOINED_SUBCLASS

public static final int TYPE_JOINED_SUBCLASS
See Also:
Constant Field Values

TYPE_COMPONENT

public static final int TYPE_COMPONENT
See Also:
Constant Field Values

absoluteValueObjectClassName

protected java.lang.String absoluteValueObjectClassName
Constructor Detail

HibernateClass

public HibernateClass(org.w3c.dom.Node node,
                      java.lang.String packageName,
                      IProject project,
                      HibernateDocument document)
Constructor for non-subclass

Parameters:
node - the XML node
packageName - the package name for this class
project - the Eclipse project

HibernateClass

public HibernateClass(org.w3c.dom.Node node,
                      java.lang.String packageName,
                      HibernateClass parent,
                      IProject project,
                      HibernateDocument document)
Constructor for subclass

Parameters:
node - the XML node
packageName - the package name for this class
parent - the parent for this subclass
project - the Eclipse project

HibernateClass

public HibernateClass(org.w3c.dom.Node node,
                      java.lang.String packageName,
                      HibernateClass parent,
                      IProject project,
                      boolean validate,
                      int type,
                      HibernateDocument document)
Constructor for component

Parameters:
node - the XML node
packageName - the package name for this class
parent - the parent for this component
project - the Eclipse project
validate - whether or not to allow full data
type - the type of class (matches the TYPE statics in this class)
Method Detail

setValueObjectClassName

protected void setValueObjectClassName(java.lang.String name)
Set the name of this class

Parameters:
name -

getValueObjectClassName

public java.lang.String getValueObjectClassName()
Return the name of the extension class without any package prefix that represents the value object used by hibernate for persistance


getAbsoluteValueObjectClassName

public java.lang.String getAbsoluteValueObjectClassName()
Return the fully qualified name of the extension class that represents the value object used by hibernate for persistance

Returns:
the fully qualified class name

getValueObjectProxyClassName

public java.lang.String getValueObjectProxyClassName()
Return the relative class name of the proxy or null if N/A


getAbsoluteValueObjectProxyClassName

public java.lang.String getAbsoluteValueObjectProxyClassName()
Return the fully qualitifed name of the proxy or null if N/A


getValueObjectSignatureClassName

public java.lang.String getValueObjectSignatureClassName()
Return the name of the extension class without any package prefix that represents the value object used by hibernate for persistance (or the proxy if exists)


getAbsoluteValueObjectSignatureClassName

public java.lang.String getAbsoluteValueObjectSignatureClassName()
Return the fully qualified name of the extension class that represents the business object used by hibernate for persistance (or the proxy if exists)

Returns:
the fully qualified class name

getBaseValueObjectClassName

public java.lang.String getBaseValueObjectClassName()
Return the name without the package prefix of the base value object class used for the hibernate persistance


getBaseDAOClassName

public java.lang.String getBaseDAOClassName()
Return the name without the package prefix of the base DAO class used as the SessionFactory wrapper


getDAOClassName

public java.lang.String getDAOClassName()
Return the name without the package prefix of the extension DAO class used as the SessionFactory wrapper


getAbsoluteDAOClassName

public java.lang.String getAbsoluteDAOClassName()
Return the fully qualified class name of the DAO used for the hibernate persistance


getAbsoluteBaseDAOClassName

public java.lang.String getAbsoluteBaseDAOClassName()
Return the fully qualified class name of the Base DAO used for the hibernate persistance


getAbsoluteBaseValueObjectClassName

public java.lang.String getAbsoluteBaseValueObjectClassName()
Return the fully qualified class name of the base value object class used for the hibernate persistance


getValueObjectPackage

public java.lang.String getValueObjectPackage()
Return the package prefix without the class name of the extension class that represents the value object used by hibernate for persistance

Returns:
the package name

getProxyPackage

public java.lang.String getProxyPackage()
Return the package of the proxy for this class or null if N/A


getBaseValueObjectPackage

public java.lang.String getBaseValueObjectPackage()
Return the package prefix that relates to the base DAO class used as the wrapper to the SessionFactory access


getDAOPackage

public java.lang.String getDAOPackage()
Return the package prefix that relates to the extension DAO class used as the wrapper to the SessionFactory access


getBaseDAOPackage

public java.lang.String getBaseDAOPackage()
Return the package prefix that relates to the base DAO class used as the wrapper to the SessionFactory access


getRootDAOPackage

public java.lang.String getRootDAOPackage()
Return the package prefix of the root DAO class.


getLabel

public java.lang.String getLabel()
Return a descriptive label based on the class name (or using the 'label' meta override)


getVarName

public java.lang.String getVarName()
Return the variable name related to this class that will be used for the generation


getId

public HibernateClassId getId()
Return the id object for the given HibernateClass


getId

public HibernateClassId getId(boolean goToParent)
Return the id object for the given HibernateClass


getProperties

public java.util.List getProperties()
return the properties that represent the standard columns in the that relating to this hibernate class

Returns:
a List of HibernateClassProperty objects

getPropertiesWithComponents

public java.util.List getPropertiesWithComponents()
Return a list of all properties including the properties are hidden inside the components that belong to this class

Returns:
a list of IHibernateClassProperty objects

getManyToOneList

public java.util.List getManyToOneList()
Return the objects that represent many-to-one relationships for the hibernate class

Returns:
a List of HibernateClassProperty objects

getOneToOneList

public java.util.List getOneToOneList()
Return the objects that represent one-to-one relationships for the hibernate class

Returns:
a List of HibernateClassProperty objects

getTableName

public java.lang.String getTableName()
Return the name of the table that will be used for persistance of this hibernate class


getCollectionList

public java.util.List getCollectionList()
Return the list of collection objects for this hibernate class

Returns:
a List of HibernateClassCollectionProperty objects

getSubclassList

public java.util.List getSubclassList()
Return a list of class that will subclass this hibernate class

Returns:
a list of HibernateClass objects

getComponentList

public java.util.List getComponentList()
Return a list of the components that are defined for this class

Returns:
a list of ComponentHibernateClass objects

getParent

public HibernateClass getParent()
Return the parent HibernateClass object if this is a subclass or null if N/A

Returns:
the parent of the subclass

isSubclass

public boolean isSubclass()
Return true if this class is a subclass or false if not


getQueries

public java.util.List getQueries()
Return a list of objects represent the query definitions related to this class.

Note: since queries are not defined within the class node, queries will only be added if there is a single class definition in the mapping configuration file.

Returns:
a list of HibernateQuery objects

setQueries

public void setQueries(java.util.List queries)
Set the queries for this class


getProject

public IProject getProject()
Return the eclipse project related to the resource

Returns:
the current eclipse project

canSyncDAO

public boolean canSyncDAO()
Returns:
true if this class is been allowed to auto-sync the related DAO class and false if not

canSyncValueObject

public boolean canSyncValueObject()
Returns:
true if this class is been allowed to auto-sync the value object files and false if not

canSyncCustom

public boolean canSyncCustom()
Returns:
true if this class is been allowed to auto-sync the custom templates and false if not

getAbsoluteBaseRootDAOClassName

public java.lang.String getAbsoluteBaseRootDAOClassName()
Return the fully qualified class name of the base root DAO class.


getAbsoluteRootDAOClassName

public java.lang.String getAbsoluteRootDAOClassName()
Return the fully qualified class name of the root DAO class.


getRootDAOClassName

public java.lang.String getRootDAOClassName()
Return the class name of the root DAO class without the package prefix.


useCustomDAO

public boolean useCustomDAO()
Returns:
true if this class uses a custom DAO and false if not

getBaseRootDAOClassName

public java.lang.String getBaseRootDAOClassName()
Return the class name of the root DAO class without the package prefix.


getVersion

public HibernateClassProperty getVersion()
Return the HibernateClassProperty that relates to the version or null if N/A


getTimestamp

public HibernateClassProperty getTimestamp()
Return the HibernateClassProperty that relates to the timestamp or null if N/A


getAlternateKeys

public java.util.List getAlternateKeys()
Return a list of properties that relate to the alternate keys (or a 0 length list if N/A)

Returns:
a list of IHibernateClassProperty objects

getRequiredFields

public java.util.List getRequiredFields()
Return a list of properties that are required

Returns:
a list of IHibernateClassProperty objects

getParentRoot

public HibernateClass getParentRoot()
Return the root parent of a subclass or this if no subclass

Overrides:
getParentRoot in class BaseElement

getAllProperties

public java.util.Collection getAllProperties()
Return all the properties of the class but do not include any composite key properties

Returns:
a list of IHibernateClassProperty

getAllProperties

public java.util.Collection getAllProperties(boolean addCompositeKeyProperties)
Return all the properties of the class

Returns:
a list of IHibernateClassProperty objects

getProperty

public IHibernateClassProperty getProperty(java.lang.String propName)
Return the property matching the property name


getPropertyByColName

public IHibernateClassProperty getPropertyByColName(java.lang.String colName)
Return the property matching the column name


hasProxy

public boolean hasProxy()
Return true if this class has a proxy and false if not


isComponent

public boolean isComponent()

getValueObjectScope

public java.lang.String getValueObjectScope()
Return the class scope of the value object

Returns:

getDocument

public HibernateDocument getDocument()
Return the document that relates to this mapping file


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