|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.commons.AbstractGrailsClass org.codehaus.groovy.grails.orm.hibernate.GrailsHibernateDomainClass
public class GrailsHibernateDomainClass
An implementation of the GrailsDomainClass interface that allows Classes mapped in Hibernate to integrate with Grails' validation, dynamic methods etc. seamlessly
Field Summary |
---|
Fields inherited from interface org.codehaus.groovy.grails.commons.GrailsDomainClass |
---|
GORM, ORM_MAPPING |
Constructor Summary | |
---|---|
GrailsHibernateDomainClass(Class clazz,
org.hibernate.SessionFactory sessionFactory,
org.hibernate.metadata.ClassMetadata metaData)
Contructor to be used by all child classes to create a new instance and get the name right. |
Method Summary | |
---|---|
Map |
getAssociationMap()
Returns this classes association map |
Map |
getConstrainedProperties()
Returns a map of constraints applied to this domain class with the keys being the property name and the values being ConstrainedProperty instances |
String |
getFieldName(String propertyName)
Returns the field name for the given property name |
GrailsDomainClassProperty |
getIdentifier()
Returns the identifier property |
Map |
getMappedBy()
|
String |
getMappingStrategy()
|
GrailsDomainClassProperty[] |
getPersistantProperties()
Deprecated. |
GrailsDomainClassProperty[] |
getPersistentProperties()
Returns all of the persistant properties of the domain class |
GrailsDomainClassProperty[] |
getProperties()
Returns all of the properties of the domain class |
GrailsDomainClassProperty |
getPropertyByName(String name)
Returns the property for the given name |
Class |
getRelatedClassType(String propertyName)
Returns the type of the related class of the given property |
Set |
getSubClasses()
Returns the sub-classes for this class if any |
Validator |
getValidator()
Retreives the validator for this domain class |
GrailsDomainClassProperty |
getVersion()
Returns the version property |
boolean |
hasPersistentProperty(String propertyName)
Returns true if this domain class has a persistent property for the given name |
boolean |
hasSubClasses()
Returns true if the domain classes has sub classes |
boolean |
isBidirectional(String propertyName)
Returns true if the given property is a bi-directional relationship |
boolean |
isManyToOne(String propertyName)
Returns true if the given property is a many to one relationship |
boolean |
isOneToMany(String propertyName)
Returns true if the given property is a one to many relationship |
boolean |
isOwningClass(Class domainClass)
|
boolean |
isRoot()
Whether the class is the root of a heirarchy |
void |
refreshConstraints()
Refreshes the constraint defined on a domain class |
void |
setMappingStrategy(String strategy)
Sets the strategy to use for ORM mapping. |
void |
setValidator(Validator validator)
Sets the validator for this domain class |
Methods inherited from class org.codehaus.groovy.grails.commons.AbstractGrailsClass |
---|
getClazz, getFullName, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyName, getPropertyOrStaticPropertyOrFieldValue, getPropertyValue, getPropertyValue, getReference, getShortName, hasProperty, newInstance, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.codehaus.groovy.grails.commons.GrailsDomainClass |
---|
getPropertyName |
Methods inherited from interface org.codehaus.groovy.grails.commons.GrailsClass |
---|
getClazz, getFullName, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyValue, getPropertyValue, getReference, getShortName, hasProperty, newInstance |
Constructor Detail |
---|
public GrailsHibernateDomainClass(Class clazz, org.hibernate.SessionFactory sessionFactory, org.hibernate.metadata.ClassMetadata metaData)
Contructor to be used by all child classes to create a new instance and get the name right.
clazz
- the Grails classsessionFactory
- The Hibernate SessionFactory instancemetaData
- The ClassMetaData for this class retrieved from the SFMethod Detail |
---|
public boolean isOwningClass(Class domainClass)
isOwningClass
in interface GrailsDomainClass
public GrailsDomainClassProperty[] getProperties()
GrailsDomainClass
getProperties
in interface GrailsDomainClass
public GrailsDomainClassProperty[] getPersistantProperties()
GrailsDomainClass
getPersistantProperties
in interface GrailsDomainClass
public GrailsDomainClassProperty[] getPersistentProperties()
GrailsDomainClass
getPersistentProperties
in interface GrailsDomainClass
public GrailsDomainClassProperty getIdentifier()
GrailsDomainClass
getIdentifier
in interface GrailsDomainClass
public GrailsDomainClassProperty getVersion()
GrailsDomainClass
getVersion
in interface GrailsDomainClass
public GrailsDomainClassProperty getPropertyByName(String name)
GrailsDomainClass
getPropertyByName
in interface GrailsDomainClass
name
- The property for the name
public String getFieldName(String propertyName)
GrailsDomainClass
getFieldName
in interface GrailsDomainClass
public boolean hasSubClasses()
GrailsDomainClass
hasSubClasses
in interface GrailsDomainClass
public Map getMappedBy()
getMappedBy
in interface GrailsDomainClass
public boolean hasPersistentProperty(String propertyName)
GrailsDomainClass
hasPersistentProperty
in interface GrailsDomainClass
propertyName
- The property name
public void setMappingStrategy(String strategy)
GrailsDomainClass
setMappingStrategy
in interface GrailsDomainClass
strategy
- The mapping strategypublic boolean isOneToMany(String propertyName)
GrailsDomainClass
isOneToMany
in interface GrailsDomainClass
propertyName
- The name of the property
public boolean isManyToOne(String propertyName)
GrailsDomainClass
isManyToOne
in interface GrailsDomainClass
propertyName
- The name of the property
public boolean isBidirectional(String propertyName)
GrailsDomainClass
isBidirectional
in interface GrailsDomainClass
propertyName
- The name of the property
public Class getRelatedClassType(String propertyName)
GrailsDomainClass
getRelatedClassType
in interface GrailsDomainClass
propertyName
- The name of the property
public Map getConstrainedProperties()
GrailsDomainClass
getConstrainedProperties
in interface GrailsDomainClass
public Validator getValidator()
GrailsDomainClass
getValidator
in interface GrailsDomainClass
public void setValidator(Validator validator)
GrailsDomainClass
setValidator
in interface GrailsDomainClass
validator
- The domain class validator to setpublic String getMappingStrategy()
getMappingStrategy
in interface GrailsDomainClass
public Set getSubClasses()
GrailsDomainClass
getSubClasses
in interface GrailsDomainClass
public void refreshConstraints()
GrailsDomainClass
refreshConstraints
in interface GrailsDomainClass
public boolean isRoot()
GrailsDomainClass
isRoot
in interface GrailsDomainClass
public Map getAssociationMap()
GrailsDomainClass
getAssociationMap
in interface GrailsDomainClass
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |