public class DefaultGrailsDomainClass extends AbstractGrailsClass implements GrailsDomainClass, ComponentCapableDomainClass
grailsApplicationGORM, ORM_MAPPING| Constructor and Description |
|---|
DefaultGrailsDomainClass(java.lang.Class<?> clazz)
Constructor.
|
DefaultGrailsDomainClass(java.lang.Class<?> clazz,
java.util.Map<java.lang.String,java.lang.Object> defaultConstraints)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(GrailsDomainClass component)
Adds a component
|
java.util.Map |
getAssociationMap()
Retrieves the association map
|
java.util.List<GrailsDomainClassProperty> |
getAssociations() |
java.util.List<GrailsDomainClass> |
getComponents()
Gets all the components for this domain class
|
java.util.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
|
java.lang.String |
getFieldName(java.lang.String propertyName)
Returns the field name for the given property name
|
GrailsDomainClassProperty |
getIdentifier()
Returns the identifier property
|
java.util.Map |
getMappedBy() |
java.lang.String |
getMappingStrategy() |
java.lang.String |
getName()
Returns the logical name of the class in the application without the trailing convention part if applicable
and without the package name.
|
GrailsDomainClassProperty[] |
getPersistantProperties()
Deprecated.
|
GrailsDomainClassProperty[] |
getPersistentProperties()
Returns all of the persistant properties of the domain class
|
GrailsDomainClassProperty |
getPersistentProperty(java.lang.String name)
Returns the property for the given name or null if non exists
|
GrailsDomainClassProperty[] |
getProperties()
Returns all of the properties of the domain class
|
GrailsDomainClassProperty |
getPropertyByName(java.lang.String name)
Returns the property for the given name
|
java.lang.String |
getPropertyName()
Returns the name of the class as a property name.
|
java.lang.Class<?> |
getRelatedClassType(java.lang.String propertyName)
Returns the type of the related class of the given property
|
java.util.Set |
getSubClasses()
Returns the sub-classes for this class if any
|
org.springframework.validation.Validator |
getValidator()
Retreives the validator for this domain class
|
GrailsDomainClassProperty |
getVersion()
Returns the version property
|
boolean |
hasPersistentProperty(java.lang.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(java.lang.String propertyName)
Returns true if the given property is a bi-directional relationship
|
boolean |
isManyToOne(java.lang.String propertyName)
Returns true if the given property is a many to one relationship
|
boolean |
isOneToMany(java.lang.String propertyName)
Returns true if the given property is a one to many relationship
|
boolean |
isOwningClass(java.lang.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(java.lang.String strategy)
Sets the strategy to use for ORM mapping.
|
void |
setValidator(org.springframework.validation.Validator validator)
Sets the validator for this domain class
|
getClazz, getFullName, getGrailsApplication, getLogicalPropertyName, getMetaClass, getNaturalName, getPackageName, getPropertyDescriptors, getPropertyOrStaticPropertyOrFieldValue, getPropertyType, getPropertyValue, getPropertyValue, getPropertyValueObject, getReference, getReferenceInstance, getShortName, getStaticPropertyValue, hasMetaMethod, hasMetaMethod, hasMetaProperty, hasProperty, isAbstract, isActionMethod, isReadableProperty, newInstance, setGrailsApplication, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetClazz, getFullName, getGrailsApplication, getLogicalPropertyName, getMetaClass, getNaturalName, getPackageName, getPropertyValue, getPropertyValue, getReference, getReferenceInstance, getShortName, hasProperty, isAbstract, newInstancesetGrailsApplicationpublic DefaultGrailsDomainClass(java.lang.Class<?> clazz,
java.util.Map<java.lang.String,java.lang.Object> defaultConstraints)
clazz - defaultConstraints - public DefaultGrailsDomainClass(java.lang.Class<?> clazz)
clazz - public boolean hasSubClasses()
GrailsDomainClasshasSubClasses in interface GrailsDomainClasspublic java.util.Map getAssociationMap()
getAssociationMap in interface GrailsDomainClasspublic boolean isOwningClass(java.lang.Class domainClass)
isOwningClass in interface GrailsDomainClasspublic GrailsDomainClassProperty[] getProperties()
GrailsDomainClassgetProperties in interface GrailsDomainClasspublic GrailsDomainClassProperty getIdentifier()
GrailsDomainClassgetIdentifier in interface GrailsDomainClasspublic GrailsDomainClassProperty getVersion()
GrailsDomainClassgetVersion in interface GrailsDomainClass@Deprecated public GrailsDomainClassProperty[] getPersistantProperties()
GrailsDomainClassgetPersistantProperties in interface GrailsDomainClassGrailsDomainClass.getPersistantProperties()public GrailsDomainClassProperty[] getPersistentProperties()
GrailsDomainClassgetPersistentProperties in interface GrailsDomainClasspublic GrailsDomainClassProperty getPropertyByName(java.lang.String name)
GrailsDomainClassgetPropertyByName in interface GrailsDomainClassname - The property for the namepublic GrailsDomainClassProperty getPersistentProperty(java.lang.String name)
GrailsDomainClassgetPersistentProperty in interface GrailsDomainClassname - The property namepublic java.lang.String getFieldName(java.lang.String propertyName)
GrailsDomainClassgetFieldName in interface GrailsDomainClasspublic java.lang.String getName()
GrailsClassgetName in interface GrailsClassgetName in class AbstractGrailsClasspublic boolean isOneToMany(java.lang.String propertyName)
GrailsDomainClassisOneToMany in interface GrailsDomainClasspropertyName - The name of the propertypublic boolean isManyToOne(java.lang.String propertyName)
GrailsDomainClassisManyToOne in interface GrailsDomainClasspropertyName - The name of the propertypublic java.lang.Class<?> getRelatedClassType(java.lang.String propertyName)
GrailsDomainClassgetRelatedClassType in interface GrailsDomainClasspropertyName - The name of the propertypublic java.lang.String getPropertyName()
GrailsClassgetPropertyName in interface GrailsClassgetPropertyName in interface GrailsDomainClassgetPropertyName in class AbstractGrailsClasspublic boolean isBidirectional(java.lang.String propertyName)
GrailsDomainClassisBidirectional in interface GrailsDomainClasspropertyName - The name of the propertypublic java.util.Map getConstrainedProperties()
GrailsDomainClassgetConstrainedProperties in interface GrailsDomainClasspublic org.springframework.validation.Validator getValidator()
GrailsDomainClassgetValidator in interface GrailsDomainClasspublic void setValidator(org.springframework.validation.Validator validator)
GrailsDomainClasssetValidator in interface GrailsDomainClassvalidator - The domain class validator to setpublic java.lang.String getMappingStrategy()
getMappingStrategy in interface GrailsDomainClasspublic boolean isRoot()
GrailsDomainClassisRoot in interface GrailsDomainClasspublic java.util.Set getSubClasses()
GrailsDomainClassgetSubClasses in interface GrailsDomainClasspublic void refreshConstraints()
GrailsDomainClassrefreshConstraints in interface GrailsDomainClasspublic java.util.Map getMappedBy()
getMappedBy in interface GrailsDomainClasspublic boolean hasPersistentProperty(java.lang.String propertyName)
GrailsDomainClasshasPersistentProperty in interface GrailsDomainClasspropertyName - The property namepublic void setMappingStrategy(java.lang.String strategy)
GrailsDomainClasssetMappingStrategy in interface GrailsDomainClassstrategy - The mapping strategypublic void addComponent(GrailsDomainClass component)
ComponentCapableDomainClassaddComponent in interface ComponentCapableDomainClasscomponent - The componentpublic java.util.List<GrailsDomainClass> getComponents()
ComponentCapableDomainClassgetComponents in interface ComponentCapableDomainClasspublic java.util.List<GrailsDomainClassProperty> getAssociations()