|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GrailsDomainClass
Represents a persistable Grails domain class
Field Summary | |
---|---|
static String |
GORM
The name of the default ORM implementation used to map the class |
static String |
ORM_MAPPING
|
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. Use #getPersistentProperties instead |
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 default property name of the GrailsClass. |
Class |
getRelatedClassType(String propertyName)
Returns the type of the related class of the given property |
Set<GrailsDomainClass> |
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 interface org.codehaus.groovy.grails.commons.GrailsClass |
---|
getClazz, getFullName, getLogicalPropertyName, getMetaClass, getName, getNaturalName, getPackageName, getPropertyValue, getPropertyValue, getReference, getReferenceInstance, getShortName, hasProperty, newInstance |
Field Detail |
---|
static final String GORM
static final String ORM_MAPPING
Method Detail |
---|
boolean isOwningClass(Class domainClass)
domainClass
-
GrailsDomainClassProperty[] getProperties()
GrailsDomainClassProperty[] getPersistantProperties()
GrailsDomainClassProperty[] getPersistentProperties()
GrailsDomainClassProperty getIdentifier()
GrailsDomainClassProperty getVersion()
Map getAssociationMap()
GrailsDomainClassProperty getPropertyByName(String name)
name
- The property for the name
InvalidPropertyException
String getFieldName(String propertyName)
propertyName
-
String getPropertyName()
Returns the default property name of the GrailsClass. For example the property name for a class called "User" would be "user"
getPropertyName
in interface GrailsClass
boolean isOneToMany(String propertyName)
propertyName
- The name of the property
boolean isManyToOne(String propertyName)
propertyName
- The name of the property
boolean isBidirectional(String propertyName)
propertyName
- The name of the property
Class getRelatedClassType(String propertyName)
propertyName
- The name of the property
Map getConstrainedProperties()
Validator getValidator()
void setValidator(Validator validator)
validator
- The domain class validator to setString getMappingStrategy()
boolean isRoot()
Set<GrailsDomainClass> getSubClasses()
void refreshConstraints()
boolean hasSubClasses()
Map getMappedBy()
boolean hasPersistentProperty(String propertyName)
propertyName
- The property name
void setMappingStrategy(String strategy)
strategy
- The mapping strategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |