|
||||||||||
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.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 GrailsDomainClass
public Map getAssociationMap()
getAssociationMap
in interface GrailsDomainClass
public boolean isOwningClass(Class domainClass)
isOwningClass
in interface GrailsDomainClass
public GrailsDomainClassProperty[] getProperties()
GrailsDomainClass
getProperties
in interface GrailsDomainClass
public GrailsDomainClassProperty getIdentifier()
GrailsDomainClass
getIdentifier
in interface GrailsDomainClass
public GrailsDomainClassProperty getVersion()
GrailsDomainClass
getVersion
in interface GrailsDomainClass
public GrailsDomainClassProperty[] getPersistantProperties()
GrailsDomainClass
getPersistantProperties
in interface GrailsDomainClass
GrailsDomainClass.getPersistantProperties()
public GrailsDomainClassProperty[] getPersistentProperties()
GrailsDomainClass
getPersistentProperties
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 String getName()
GrailsClass
Returns the logical name of the class in the application without the trailing convention part if applicable and without the package name.
getName
in interface GrailsClass
getName
in class AbstractGrailsClass
public 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
protected Object getPropertyOrStaticPropertyOrFieldValue(String name, Class type)
AbstractGrailsClass
Looks 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 AbstractGrailsClass
public Class getRelatedClassType(String propertyName)
GrailsDomainClass
getRelatedClassType
in interface GrailsDomainClass
propertyName
- The name of the property
public String getPropertyName()
GrailsClass
Returns the name of the class as a property name
getPropertyName
in interface GrailsClass
getPropertyName
in interface GrailsDomainClass
getPropertyName
in class AbstractGrailsClass
public boolean isBidirectional(String propertyName)
GrailsDomainClass
isBidirectional
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 boolean isRoot()
GrailsDomainClass
isRoot
in interface GrailsDomainClass
public Set getSubClasses()
GrailsDomainClass
getSubClasses
in interface GrailsDomainClass
public void refreshConstraints()
GrailsDomainClass
refreshConstraints
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 strategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |