|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.groovy.grails.commons.DefaultGrailsDomainClassProperty
public class DefaultGrailsDomainClassProperty
A class that represents a property of a domain class and contains meta information about the properties relationships, naming conventions and type
| Field Summary |
|---|
| Fields inherited from interface org.codehaus.groovy.grails.commons.GrailsDomainClassProperty |
|---|
BELONGS_TO, CLASS, CONSTRAINTS, DATE_CREATED, EMBEDDED, EVANESCENT, FETCH_EAGER, FETCH_LAZY, FETCH_MODE, HAS_MANY, IDENTITY, LAST_UPDATED, MAPPED_BY, MAPPING, MAPPING_STRATEGY, META_CLASS, RELATES_TO_MANY, TRANSIENT, VERSION |
| Constructor Summary | |
|---|---|
DefaultGrailsDomainClassProperty(GrailsDomainClass domainClass,
PropertyDescriptor descriptor)
|
|
| Method Summary | |
|---|---|
GrailsDomainClass |
getComponent()
If #isEmbedded returns true then this method can be called to obtain a reference to the embedded component, which implements the GrailsDomainClass interface |
GrailsDomainClass |
getDomainClass()
Returns the parent domain class of the property instance |
int |
getFetchMode()
Returns the configured fetch mode for the property |
String |
getFieldName()
Returns the domain field name for this property |
String |
getName()
Returns the name of the property |
String |
getNaturalName()
|
GrailsDomainClassProperty |
getOtherSide()
Returns the other side of a bidirectional association |
GrailsDomainClass |
getReferencedDomainClass()
Returns the GrailsDomainClass of a relationship property or null if the property is not a relationship property |
String |
getReferencedPropertyName()
Retrieves the name of property referenced by this property if it is an association and is known, otherwise null |
Class |
getReferencedPropertyType()
Returns the referenced property type. |
Class |
getType()
Returns the type for the domain class |
String |
getTypePropertyName()
Returns the class type as a property name representation |
boolean |
isAssociation()
Returns true if this property is a relationship property |
boolean |
isBidirectional()
Returns true if the property is a bi-directional relationship |
boolean |
isCircular()
Whether the relationship is cirucular |
boolean |
isEmbedded()
Returns true if this propert is an embedded component |
boolean |
isIdentity()
Returns true of the property is an identifier |
boolean |
isInherited()
Whether the property is inherited from a super class |
boolean |
isManyToMany()
Returns true if the property is a many-to-many relationship |
boolean |
isManyToOne()
Returns true if the property is a many-to-one relationship |
boolean |
isOneToMany()
Returns true if the property is a one-to-many relationship |
boolean |
isOneToOne()
Returns true if the property is a one-to-one relationship |
boolean |
isOptional()
Returns true if the property is required |
boolean |
isOwningSide()
Whether this side of the association is the "owning" side |
boolean |
isPersistent()
Returns true if the domain class property is a persistent property |
protected void |
setBidirectional(boolean bidirectional)
Sets whether the relationship is bidirectional or not |
void |
setEmbedded(boolean isEmbedded)
|
protected void |
setManyToMany(boolean manyToMany)
|
protected void |
setManyToOne(boolean manyToOne)
|
protected void |
setOneToMany(boolean oneToMany)
|
protected void |
setOneToOne(boolean oneToOne)
|
void |
setOtherSide(GrailsDomainClassProperty property)
Sets the other side of an associative property |
void |
setOwningSide(boolean b)
|
protected void |
setPersistant(boolean persistant)
|
void |
setReferencedDomainClass(GrailsDomainClass referencedDomainClass)
Sets the references domain class on the property |
protected void |
setReferencedPropertyType(Class referencedPropertyType)
Sets the referenced property type of this property |
void |
setReferencePropertyName(String name)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultGrailsDomainClassProperty(GrailsDomainClass domainClass,
PropertyDescriptor descriptor)
| Method Detail |
|---|
public String getName()
GrailsDomainClassProperty
getName in interface GrailsDomainClassPropertypublic Class getType()
GrailsDomainClassProperty
getType in interface GrailsDomainClassPropertypublic boolean isPersistent()
GrailsDomainClassProperty
isPersistent in interface GrailsDomainClassPropertypublic boolean isOptional()
GrailsDomainClassProperty
isOptional in interface GrailsDomainClassPropertypublic boolean isIdentity()
GrailsDomainClassProperty
isIdentity in interface GrailsDomainClassPropertypublic boolean isOneToMany()
GrailsDomainClassProperty
isOneToMany in interface GrailsDomainClassPropertypublic boolean isManyToOne()
GrailsDomainClassProperty
isManyToOne in interface GrailsDomainClassPropertypublic String getFieldName()
GrailsDomainClassProperty
getFieldName in interface GrailsDomainClassPropertypublic boolean isOneToOne()
GrailsDomainClassProperty
isOneToOne in interface GrailsDomainClassPropertypublic GrailsDomainClass getDomainClass()
GrailsDomainClassProperty
getDomainClass in interface GrailsDomainClassPropertypublic boolean isManyToMany()
GrailsDomainClassProperty
isManyToMany in interface GrailsDomainClassPropertyprotected void setManyToMany(boolean manyToMany)
manyToMany - The manyToMany to set.protected void setOneToMany(boolean oneToMany)
oneToMany - The oneToMany to set.protected void setManyToOne(boolean manyToOne)
manyToOne - The manyToOne to set.protected void setOneToOne(boolean oneToOne)
oneToOne - The oneToOne to set.protected void setPersistant(boolean persistant)
persistant - The persistant to set.protected void setBidirectional(boolean bidirectional)
public String getTypePropertyName()
GrailsDomainClassProperty
getTypePropertyName in interface GrailsDomainClassPropertypublic Class getReferencedPropertyType()
GrailsDomainClassPropertyReturns the referenced property type. This differs from getType() in that in the case of an Association it will return the type of the elements contained within the Collection, otherwise it will delegate to getType();
getReferencedPropertyType in interface GrailsDomainClassPropertypublic boolean isBidirectional()
GrailsDomainClassProperty
isBidirectional in interface GrailsDomainClassPropertyprotected void setReferencedPropertyType(Class referencedPropertyType)
public GrailsDomainClass getReferencedDomainClass()
GrailsDomainClassProperty
getReferencedDomainClass in interface GrailsDomainClassPropertypublic void setReferencedDomainClass(GrailsDomainClass referencedDomainClass)
GrailsDomainClassProperty
setReferencedDomainClass in interface GrailsDomainClassPropertypublic boolean isAssociation()
GrailsDomainClassProperty
isAssociation in interface GrailsDomainClassPropertypublic String getNaturalName()
getNaturalName in interface GrailsDomainClassPropertypublic String toString()
toString in class Objectpublic GrailsDomainClassProperty getOtherSide()
GrailsDomainClassPropertyReturns the other side of a bidirectional association
getOtherSide in interface GrailsDomainClassPropertypublic void setOtherSide(GrailsDomainClassProperty property)
GrailsDomainClassProperty
setOtherSide in interface GrailsDomainClassPropertypublic boolean isInherited()
GrailsDomainClassProperty
isInherited in interface GrailsDomainClassPropertypublic int getFetchMode()
GrailsDomainClassProperty
getFetchMode in interface GrailsDomainClassPropertypublic boolean isOwningSide()
GrailsDomainClassProperty
isOwningSide in interface GrailsDomainClassPropertypublic void setOwningSide(boolean b)
setOwningSide in interface GrailsDomainClassPropertypublic boolean isCircular()
GrailsDomainClassProperty
isCircular in interface GrailsDomainClassPropertypublic void setReferencePropertyName(String name)
public String getReferencedPropertyName()
GrailsDomainClassProperty
getReferencedPropertyName in interface GrailsDomainClassPropertypublic boolean isEmbedded()
GrailsDomainClassProperty
isEmbedded in interface GrailsDomainClassPropertypublic GrailsDomainClass getComponent()
GrailsDomainClassProperty
getComponent in interface GrailsDomainClassPropertyGrailsDomainClass,
GrailsDomainClassProperty.isEmbedded()public void setEmbedded(boolean isEmbedded)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||