|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.groovy.grails.commons.AbstractGrailsClass
org.codehaus.groovy.grails.commons.DefaultGrailsDomainClass
public class DefaultGrailsDomainClass
| Field Summary |
|---|
| Fields inherited from interface org.codehaus.groovy.grails.commons.GrailsDomainClass |
|---|
GORM, ORM_MAPPING |
| Constructor Summary | |
|---|---|
DefaultGrailsDomainClass(Class clazz)
|
|
DefaultGrailsDomainClass(Class clazz,
Map<String,Object> defaultConstraints)
|
|
| Method Summary | |
|---|---|
Map |
getAssociationMap()
Retrieves the 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()
|
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[] |
getProperties()
Returns all of the properties of the domain class |
GrailsDomainClassProperty |
getPropertyByName(String name)
Returns the property for the given name |
String |
getPropertyName()
Returns the name of the class as a property name |
protected Object |
getPropertyOrStaticPropertyOrFieldValue(String name,
Class type)
Looks for a property of the reference instance with a given name and type. |
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, getNaturalName, getPackageName, getPropertyDescriptors, getPropertyType, getPropertyValue, getPropertyValue, getPropertyValueObject, getReference, getReferenceInstance, getShortName, hasMetaMethod, hasMetaMethod, hasMetaProperty, hasProperty, isReadableProperty, 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.GrailsClass |
|---|
getClazz, getFullName, getLogicalPropertyName, getMetaClass, getNaturalName, getPackageName, getPropertyValue, getPropertyValue, getReference, getReferenceInstance, getShortName, hasProperty, newInstance |
| Constructor Detail |
|---|
public DefaultGrailsDomainClass(Class clazz,
Map<String,Object> defaultConstraints)
public DefaultGrailsDomainClass(Class clazz)
| Method Detail |
|---|
public boolean hasSubClasses()
GrailsDomainClass
hasSubClasses in interface GrailsDomainClasspublic Map getAssociationMap()
getAssociationMap in interface GrailsDomainClasspublic boolean isOwningClass(Class domainClass)
isOwningClass in interface GrailsDomainClasspublic GrailsDomainClassProperty[] getProperties()
GrailsDomainClass
getProperties in interface GrailsDomainClasspublic GrailsDomainClassProperty getIdentifier()
GrailsDomainClass
getIdentifier in interface GrailsDomainClasspublic GrailsDomainClassProperty getVersion()
GrailsDomainClass
getVersion in interface GrailsDomainClasspublic GrailsDomainClassProperty[] getPersistantProperties()
GrailsDomainClass
getPersistantProperties in interface GrailsDomainClassGrailsDomainClass.getPersistantProperties()public GrailsDomainClassProperty[] getPersistentProperties()
GrailsDomainClass
getPersistentProperties in interface GrailsDomainClasspublic GrailsDomainClassProperty getPropertyByName(String name)
GrailsDomainClass
getPropertyByName in interface GrailsDomainClassname - The property for the name
public String getFieldName(String propertyName)
GrailsDomainClass
getFieldName in interface GrailsDomainClasspublic String getName()
GrailsClassReturns the logical name of the class in the application without the trailing convention part if applicable and without the package name.
getName in interface GrailsClassgetName in class AbstractGrailsClasspublic boolean isOneToMany(String propertyName)
GrailsDomainClass
isOneToMany in interface GrailsDomainClasspropertyName - The name of the property
public boolean isManyToOne(String propertyName)
GrailsDomainClass
isManyToOne in interface GrailsDomainClasspropertyName - The name of the property
protected Object getPropertyOrStaticPropertyOrFieldValue(String name,
Class type)
AbstractGrailsClassLooks for a property of the reference instance with a given name and type.
If found its value is returned. We follow the Java bean conventions with augmentation for groovy support and static fields/properties. We will therefore match, in this order:
getPropertyOrStaticPropertyOrFieldValue in class AbstractGrailsClasspublic Class getRelatedClassType(String propertyName)
GrailsDomainClass
getRelatedClassType in interface GrailsDomainClasspropertyName - The name of the property
public String getPropertyName()
GrailsClassReturns the name of the class as a property name
getPropertyName in interface GrailsClassgetPropertyName in interface GrailsDomainClassgetPropertyName in class AbstractGrailsClasspublic boolean isBidirectional(String propertyName)
GrailsDomainClass
isBidirectional in interface GrailsDomainClasspropertyName - The name of the property
public Map getConstrainedProperties()
GrailsDomainClass
getConstrainedProperties in interface GrailsDomainClasspublic Validator getValidator()
GrailsDomainClass
getValidator in interface GrailsDomainClasspublic void setValidator(Validator validator)
GrailsDomainClass
setValidator in interface GrailsDomainClassvalidator - The domain class validator to setpublic String getMappingStrategy()
getMappingStrategy in interface GrailsDomainClasspublic boolean isRoot()
GrailsDomainClass
isRoot in interface GrailsDomainClasspublic Set getSubClasses()
GrailsDomainClass
getSubClasses in interface GrailsDomainClasspublic void refreshConstraints()
GrailsDomainClass
refreshConstraints in interface GrailsDomainClasspublic Map getMappedBy()
getMappedBy in interface GrailsDomainClasspublic boolean hasPersistentProperty(String propertyName)
GrailsDomainClass
hasPersistentProperty in interface GrailsDomainClasspropertyName - The property name
public void setMappingStrategy(String strategy)
GrailsDomainClass
setMappingStrategy in interface GrailsDomainClassstrategy - The mapping strategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||