Groovy Documentation

org.codehaus.groovy.grails.commons
[Java] Interface GrailsDomainClassProperty


public interface GrailsDomainClassProperty

A property of a GrailsDomainClass instance.

Authors:
Graeme Rocher


Field Summary
java.lang.String BELONGS_TO

java.lang.String CLASS

java.lang.String CONSTRAINTS

java.lang.String DATE_CREATED

java.lang.String DOMAIN_CLASS

java.lang.String EMBEDDED

java.lang.String ERRORS

java.lang.String EVANESCENT

int FETCH_EAGER

int FETCH_LAZY

java.lang.String FETCH_MODE

java.lang.String HAS_MANY

java.lang.String HAS_ONE

java.lang.String IDENTITY

java.lang.String LAST_UPDATED

java.lang.String MAPPED_BY

java.lang.String MAPPING

java.lang.String MAPPING_STRATEGY

java.lang.String META_CLASS

java.lang.String NAMED_QUERIES

java.lang.String RELATES_TO_MANY

java.lang.String SORT

java.lang.String TRANSIENT

java.lang.String VERSION

 
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

java.lang.String getFieldName()

Returns the domain field name for this property.

java.lang.String getName()

Returns the name of the property.

java.lang.String getNaturalName()

Returns:
The natural name representation of the property (eg.

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.

java.lang.String getReferencedPropertyName()

Retrieves the name of property referenced by this property if it is an association and is known, otherwise null.

java.lang.Class getReferencedPropertyType()

Returns the referenced property type.

java.lang.Class getType()

Returns the type for the domain class

java.lang.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 isDerived()

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 false 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 setDerived(boolean derived)

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.

 

Field Detail

BELONGS_TO

public java.lang.String BELONGS_TO


CLASS

public java.lang.String CLASS


CONSTRAINTS

public java.lang.String CONSTRAINTS


DATE_CREATED

public java.lang.String DATE_CREATED


DOMAIN_CLASS

public java.lang.String DOMAIN_CLASS


EMBEDDED

public java.lang.String EMBEDDED


ERRORS

public java.lang.String ERRORS


EVANESCENT

public java.lang.String EVANESCENT


FETCH_EAGER

public int FETCH_EAGER


FETCH_LAZY

public int FETCH_LAZY


FETCH_MODE

public java.lang.String FETCH_MODE


HAS_MANY

public java.lang.String HAS_MANY


HAS_ONE

public java.lang.String HAS_ONE


IDENTITY

public java.lang.String IDENTITY


LAST_UPDATED

public java.lang.String LAST_UPDATED


MAPPED_BY

public java.lang.String MAPPED_BY


MAPPING

public java.lang.String MAPPING


MAPPING_STRATEGY

public java.lang.String MAPPING_STRATEGY


META_CLASS

public java.lang.String META_CLASS


NAMED_QUERIES

public java.lang.String NAMED_QUERIES


RELATES_TO_MANY

public java.lang.String RELATES_TO_MANY


SORT

public java.lang.String SORT


TRANSIENT

public java.lang.String TRANSIENT


VERSION

public java.lang.String VERSION


 
Method Detail

getComponent

public 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.
Returns:
The component or null if it is not an embedded component
See Also:
GrailsDomainClass
GrailsDomainClassProperty.isEmbedded


getDomainClass

public GrailsDomainClass getDomainClass()
Returns the parent domain class of the property instance.
Returns:
The parent domain class


getFetchMode

public int getFetchMode()
Returns the configured fetch mode for the property


getFieldName

public java.lang.String getFieldName()
Returns the domain field name for this property.


getName

public java.lang.String getName()
Returns the name of the property.
Returns:
The property name


getNaturalName

public java.lang.String getNaturalName()
Returns:
The natural name representation of the property (eg. 'lastName' becomes 'Last Name'


getOtherSide

public GrailsDomainClassProperty getOtherSide()
Returns the other side of a bidirectional association
Returns:
The other side of the relationship or null if not known


getReferencedDomainClass

public GrailsDomainClass getReferencedDomainClass()
Returns the GrailsDomainClass of a relationship property or null, if the property is not a relationship property.
Returns:
The GrailsDomainClass


getReferencedPropertyName

public java.lang.String getReferencedPropertyName()
Retrieves the name of property referenced by this property if it is an association and is known, otherwise null.
Returns:
The name of the prop


getReferencedPropertyType

@SuppressWarnings("rawtypes")
public java.lang.Class getReferencedPropertyType()
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();
Returns:
The referenced type


getType

@SuppressWarnings("rawtypes")
public java.lang.Class getType()
Returns the type for the domain class
Returns:
The property type


getTypePropertyName

public java.lang.String getTypePropertyName()
Returns the class type as a property name representation.
Returns:
The property name representation


isAssociation

public boolean isAssociation()
Returns true if this property is a relationship property.
Returns:
True if it is an associative property


isBasicCollectionType

public boolean isBasicCollectionType()
Return whether this is a collection of basic types like String, Integer etc.
Returns:
True if it is a collection of basic types


isBidirectional

public boolean isBidirectional()
Returns true if the property is a bi-directional relationship.
Returns:
A boolean value


isCircular

public boolean isCircular()
Whether the relationship is cirucular.
Returns:
True if it is


isDerived

public boolean isDerived()


isEmbedded

public boolean isEmbedded()
Returns true if this propert is an embedded component.
Returns:
True if it is, false otherwise


isEnum

public boolean isEnum()
Returns true if this properties type is an enum.
Returns:
True if it is


isHasOne

public boolean isHasOne()


isIdentity

public boolean isIdentity()
Returns true of the property is an identifier.
Returns:
Whether the property is the identifier


isInherited

public boolean isInherited()
Whether the property is inherited from a super class.
Returns:
True if its inherited


isManyToMany

public boolean isManyToMany()
Returns true if the property is a many-to-many relationship.
Returns:
True if it is a manyToMany


isManyToOne

public boolean isManyToOne()
Returns true if the property is a many-to-one relationship.
Returns:
Whether it is a manyToOne


isOneToMany

public boolean isOneToMany()
Returns true if the property is a one-to-many relationship.
Returns:
Whether it is a oneToMany


isOneToOne

public boolean isOneToOne()
Returns true if the property is a one-to-one relationship.
Returns:
True if it is a one-to-one relationship


isOptional

public boolean isOptional()
Returns false if the property is required.
Returns:
Whether the property is optional


isOwningSide

public boolean isOwningSide()
Whether this side of the association is the "owning" side.
Returns:
True if it is the owning side


isPersistent

public boolean isPersistent()
Returns true if the domain class property is a persistent property.
Returns:
Whether the property is persistent


setDerived

public void setDerived(boolean derived)


setOtherSide

public void setOtherSide(GrailsDomainClassProperty referencedProperty)
Sets the other side of an associative property.
Parameters:
referencedProperty


setOwningSide

public void setOwningSide(boolean b)


setReferencedDomainClass

public void setReferencedDomainClass(GrailsDomainClass referencedGrailsDomainClass)
Sets the references domain class on the property.
Parameters:
referencedGrailsDomainClass


 

Groovy Documentation