|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.orm.hibernate.GrailsHibernateDomainClassProperty
public class GrailsHibernateDomainClassProperty
An implementation of the GrailsDomainClassProperty interface that allows Classes mapped in Hibernate to integrate with Grails' validation, dynamic methods etc. seamlessly
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 | |
---|---|
GrailsHibernateDomainClassProperty(GrailsHibernateDomainClass domainClass,
String propertyName)
|
Method Summary | |
---|---|
String |
getColumnName()
|
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 |
setAssociation(boolean association)
|
void |
setBidirectional(boolean bidirectional)
|
void |
setColumnName(String columnName)
|
void |
setIdentity(boolean identity)
|
void |
setManyToMany(boolean manyToMany)
|
void |
setManyToOne(boolean manyToOne)
|
void |
setOneToMany(boolean oneToMany)
|
void |
setOneToOne(boolean oneToOne)
|
void |
setOptional(boolean optional)
|
void |
setOtherSide(GrailsDomainClassProperty referencedProperty)
Sets the other side of an associative property |
void |
setOwningSide(boolean b)
|
void |
setReferencedDomainClass(GrailsDomainClass referencedGrailsDomainClass)
Sets the references domain class on the property |
void |
setRelatedClassType(Class relatedType)
|
void |
setType(Class type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GrailsHibernateDomainClassProperty(GrailsHibernateDomainClass domainClass, String propertyName)
Method Detail |
---|
public String getName()
GrailsDomainClassProperty
getName
in interface GrailsDomainClassProperty
public Class getType()
GrailsDomainClassProperty
getType
in interface GrailsDomainClassProperty
public void setType(Class type)
public String getTypePropertyName()
GrailsDomainClassProperty
getTypePropertyName
in interface GrailsDomainClassProperty
public GrailsDomainClass getDomainClass()
GrailsDomainClassProperty
getDomainClass
in interface GrailsDomainClassProperty
public boolean isPersistent()
GrailsDomainClassProperty
isPersistent
in interface GrailsDomainClassProperty
public String getNaturalName()
getNaturalName
in interface GrailsDomainClassProperty
public void setReferencedDomainClass(GrailsDomainClass referencedGrailsDomainClass)
GrailsDomainClassProperty
setReferencedDomainClass
in interface GrailsDomainClassProperty
public void setOtherSide(GrailsDomainClassProperty referencedProperty)
GrailsDomainClassProperty
setOtherSide
in interface GrailsDomainClassProperty
public GrailsDomainClassProperty getOtherSide()
GrailsDomainClassProperty
Returns the other side of a bidirectional association
getOtherSide
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 isIdentity()
GrailsDomainClassProperty
isIdentity
in interface GrailsDomainClassProperty
public void setIdentity(boolean identity)
public boolean isOptional()
GrailsDomainClassProperty
isOptional
in interface GrailsDomainClassProperty
public void setOptional(boolean optional)
public boolean isOneToOne()
GrailsDomainClassProperty
isOneToOne
in interface GrailsDomainClassProperty
public void setOneToOne(boolean oneToOne)
public boolean isManyToOne()
GrailsDomainClassProperty
isManyToOne
in interface GrailsDomainClassProperty
public void setManyToOne(boolean manyToOne)
public boolean isAssociation()
GrailsDomainClassProperty
isAssociation
in interface GrailsDomainClassProperty
public boolean isEnum()
GrailsDomainClassProperty
isEnum
in interface GrailsDomainClassProperty
public void setAssociation(boolean association)
public boolean isOneToMany()
GrailsDomainClassProperty
isOneToMany
in interface GrailsDomainClassProperty
public void setOneToMany(boolean oneToMany)
public boolean isManyToMany()
GrailsDomainClassProperty
isManyToMany
in interface GrailsDomainClassProperty
public void setManyToMany(boolean manyToMany)
public boolean isBidirectional()
GrailsDomainClassProperty
isBidirectional
in interface GrailsDomainClassProperty
public String getFieldName()
GrailsDomainClassProperty
getFieldName
in interface GrailsDomainClassProperty
public void setBidirectional(boolean bidirectional)
public GrailsDomainClass getReferencedDomainClass()
GrailsDomainClassProperty
getReferencedDomainClass
in interface GrailsDomainClassProperty
public void setRelatedClassType(Class relatedType)
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 boolean isCircular()
GrailsDomainClassProperty
isCircular
in interface GrailsDomainClassProperty
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 setOwningSide(boolean b)
setOwningSide
in interface GrailsDomainClassProperty
public boolean isBasicCollectionType()
GrailsDomainClassProperty
isBasicCollectionType
in interface GrailsDomainClassProperty
public boolean isHasOne()
isHasOne
in interface GrailsDomainClassProperty
public void setColumnName(String columnName)
public String getColumnName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |