|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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, HAS_ONE, IDENTITY, LAST_UPDATED, MAPPED_BY, MAPPING, MAPPING_STRATEGY, META_CLASS, NAMED_QUERIES, RELATES_TO_MANY, SORT, TRANSIENT, VERSION |
Constructor Summary | |
---|---|
DefaultGrailsDomainClassProperty(GrailsDomainClass domainClass,
PropertyDescriptor descriptor)
|
Method Summary | |
---|---|
boolean |
equals(Object o)
Overriddent equals to take into account inherited properties e.g. childClass.propertyName is equal to parentClass.propertyName if the types match and childClass.property.isInherited |
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 |
isBasicCollectionType()
Return whether this is a collection of basic types like String, Integer etc. |
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 |
isEnum()
Returns true if this properties type is an enum |
boolean |
isHasOne()
|
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 |
void |
setBasicCollectionType(boolean b)
|
protected void |
setBidirectional(boolean bidirectional)
Sets whether the relationship is bidirectional or not |
void |
setEmbedded(boolean isEmbedded)
|
protected void |
setHasOne(boolean isHasOne)
Set whether the foreign key is stored in the parent or child in a one-to-one |
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, 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 GrailsDomainClassProperty
public Class getType()
GrailsDomainClassProperty
getType
in interface GrailsDomainClassProperty
public boolean isPersistent()
GrailsDomainClassProperty
isPersistent
in interface GrailsDomainClassProperty
public boolean isOptional()
GrailsDomainClassProperty
isOptional
in interface GrailsDomainClassProperty
public boolean isIdentity()
GrailsDomainClassProperty
isIdentity
in interface GrailsDomainClassProperty
public boolean isOneToMany()
GrailsDomainClassProperty
isOneToMany
in interface GrailsDomainClassProperty
public boolean isManyToOne()
GrailsDomainClassProperty
isManyToOne
in interface GrailsDomainClassProperty
public String getFieldName()
GrailsDomainClassProperty
getFieldName
in interface GrailsDomainClassProperty
public boolean isOneToOne()
GrailsDomainClassProperty
isOneToOne
in interface GrailsDomainClassProperty
public GrailsDomainClass getDomainClass()
GrailsDomainClassProperty
getDomainClass
in interface GrailsDomainClassProperty
public boolean isManyToMany()
GrailsDomainClassProperty
isManyToMany
in interface GrailsDomainClassProperty
protected 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 setHasOne(boolean isHasOne)
isHasOne
- True if its stored in the parentpublic boolean isHasOne()
isHasOne
in interface GrailsDomainClassProperty
protected void setPersistant(boolean persistant)
persistant
- The persistant to set.protected void setBidirectional(boolean bidirectional)
public String getTypePropertyName()
GrailsDomainClassProperty
getTypePropertyName
in interface GrailsDomainClassProperty
public Class getReferencedPropertyType()
GrailsDomainClassProperty
Returns 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 GrailsDomainClassProperty
public boolean isBidirectional()
GrailsDomainClassProperty
isBidirectional
in interface GrailsDomainClassProperty
protected void setReferencedPropertyType(Class referencedPropertyType)
public GrailsDomainClass getReferencedDomainClass()
GrailsDomainClassProperty
getReferencedDomainClass
in interface GrailsDomainClassProperty
public void setReferencedDomainClass(GrailsDomainClass referencedDomainClass)
GrailsDomainClassProperty
setReferencedDomainClass
in interface GrailsDomainClassProperty
public boolean isAssociation()
GrailsDomainClassProperty
isAssociation
in interface GrailsDomainClassProperty
public boolean isEnum()
GrailsDomainClassProperty
isEnum
in interface GrailsDomainClassProperty
public String getNaturalName()
getNaturalName
in interface GrailsDomainClassProperty
public String toString()
toString
in class Object
public GrailsDomainClassProperty getOtherSide()
GrailsDomainClassProperty
Returns the other side of a bidirectional association
getOtherSide
in interface GrailsDomainClassProperty
public void setOtherSide(GrailsDomainClassProperty property)
GrailsDomainClassProperty
setOtherSide
in interface GrailsDomainClassProperty
public boolean isInherited()
GrailsDomainClassProperty
isInherited
in interface GrailsDomainClassProperty
public int getFetchMode()
GrailsDomainClassProperty
getFetchMode
in interface GrailsDomainClassProperty
public boolean isOwningSide()
GrailsDomainClassProperty
isOwningSide
in interface GrailsDomainClassProperty
public void setOwningSide(boolean b)
setOwningSide
in interface GrailsDomainClassProperty
public boolean isCircular()
GrailsDomainClassProperty
isCircular
in interface GrailsDomainClassProperty
public void setReferencePropertyName(String name)
public String getReferencedPropertyName()
GrailsDomainClassProperty
getReferencedPropertyName
in interface GrailsDomainClassProperty
public boolean isEmbedded()
GrailsDomainClassProperty
isEmbedded
in interface GrailsDomainClassProperty
public GrailsDomainClass getComponent()
GrailsDomainClassProperty
getComponent
in interface GrailsDomainClassProperty
GrailsDomainClass
,
GrailsDomainClassProperty.isEmbedded()
public void setEmbedded(boolean isEmbedded)
public boolean equals(Object o)
equals
in class Object
o
- the Object to compare this property to
public void setBasicCollectionType(boolean b)
public boolean isBasicCollectionType()
GrailsDomainClassProperty
isBasicCollectionType
in interface GrailsDomainClassProperty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |