Package: org.codehaus.groovy.grails.commons

## [Java] Class DefaultGrailsDomainClassProperty

- org.codehaus.groovy.grails.commons.DefaultGrailsDomainClassProperty

- All Implemented Interfaces and Traits:
    GrailsDomainClassProperty

      public class DefaultGrailsDomainClassProperty
      extends java.lang.Object

  Represents a property of a domain class and contains meta information about the properties relationships, naming conventions and type.

  Authors:
    Graeme Rocher
  Since:
    0.1

- - ### Constructor Summary

    Constructors
    Constructor and description
    `DefaultGrailsDomainClassProperty (GrailsDomainClass domainClass, java.beans.PropertyDescriptor descriptor)` Constructor.
    `DefaultGrailsDomainClassProperty (GrailsDomainClass domainClass, java.beans.PropertyDescriptor descriptor, java.util.Map<java.lang.String, java.lang.Object> defaultConstraints)` Constructor.

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `boolean` | `equals(java.lang.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()`
    `GrailsDomainClass` | `getDomainClass()`
    `int` | `getFetchMode()`
    `java.lang.String` | `getFieldName()`
    `java.lang.String` | `getName()`
    `java.lang.String` | `getNaturalName()`
    `GrailsDomainClassProperty` | `getOtherSide()`
    `GrailsDomainClass` | `getReferencedDomainClass()`
    `java.lang.String` | `getReferencedPropertyName()`
    `java.lang.Class` | `getReferencedPropertyType()`
    `java.lang.Class` | `getType()`
    `java.lang.String` | `getTypePropertyName()`
    `boolean` | `isAssociation()`
    `boolean` | `isBasicCollectionType()`
    `boolean` | `isBidirectional()`
    `boolean` | `isCircular()`
    `boolean` | `isDerived()`
    `boolean` | `isEmbedded()`
    `boolean` | `isEnum()`
    `boolean` | `isExplicitSaveUpdateCascade()`
    `boolean` | `isHasOne()` @return true if the foreign key in a one-to-one is stored in the parent
    `boolean` | `isIdentity()`
    `boolean` | `isInherited()`
    `boolean` | `isManyToMany()`
    `boolean` | `isManyToOne()`
    `boolean` | `isOneToMany()`
    `boolean` | `isOneToOne()`
    `boolean` | `isOptional()`
    `boolean` | `isOwningSide()`
    `boolean` | `isPersistent()`
    `void` | `setBasicCollectionType(boolean b)`
    `protected void` | `setBidirectional(boolean bidirectional)` Sets whether the relationship is bidirectional or not
    `void` | `setDerived(boolean derived)`
    `void` | `setEmbedded(boolean isEmbedded)`
    `void` | `setExplicitSaveUpdateCascade(boolean explicitSaveUpdateCascade)`
    `protected void` | `setHasOne(boolean isHasOne)` Set whether the foreign key is stored in the parent or child in a one-to-one
    `void` | `setIdentity(boolean b)`
    `protected void` | `setManyToMany(boolean manyToMany)` @param manyToMany The manyToMany to set.
    `protected void` | `setManyToOne(boolean manyToOne)` @param manyToOne The manyToOne to set.
    `protected void` | `setOneToMany(boolean oneToMany)` @param oneToMany The oneToMany to set.
    `protected void` | `setOneToOne(boolean oneToOne)` @param oneToOne The oneToOne to set.
    `void` | `setOtherSide(GrailsDomainClassProperty property)`
    `void` | `setOwningSide(boolean b)`
    `protected void` | `setPersistent(boolean persistent)` @param persistent The persistant to set.
    `void` | `setReferencePropertyName(java.lang.String name)`
    `void` | `setReferencedDomainClass(GrailsDomainClass referencedDomainClass)`
    `protected void` | `setReferencedPropertyType(java.lang.Class<?> referencedPropertyType)` Sets the referenced property type of this property
    `java.lang.String` | `toString()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### public DefaultGrailsDomainClassProperty(GrailsDomainClass domainClass, java.beans.PropertyDescriptor descriptor)

      Constructor.

      Parameters:
        domainClass
        descriptor

    - #### @java.lang.SuppressWarnings("rawtypes") public DefaultGrailsDomainClassProperty(GrailsDomainClass domainClass, java.beans.PropertyDescriptor descriptor, java.util.Map<java.lang.String, java.lang.Object> defaultConstraints)

      Constructor.

      Parameters:
        domainClass
        descriptor

  - ### Method Detail

    - #### @java.lang.Override public boolean equals(java.lang.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

      Parameters:
        `o` - the Object to compare this property to
      Returns:
        boolean indicating equality of the two objects

    - #### public GrailsDomainClass getComponent()

    - #### public GrailsDomainClass getDomainClass()

    - #### public int getFetchMode()

    - #### public java.lang.String getFieldName()

    - #### public java.lang.String getName()

    - #### public java.lang.String getNaturalName()

    - #### public GrailsDomainClassProperty getOtherSide()

    - #### public GrailsDomainClass getReferencedDomainClass()

    - #### public java.lang.String getReferencedPropertyName()

    - #### @java.lang.SuppressWarnings("rawtypes") public java.lang.Class getReferencedPropertyType()

    - #### @java.lang.SuppressWarnings("rawtypes") public java.lang.Class getType()

    - #### public java.lang.String getTypePropertyName()

    - #### public boolean isAssociation()

    - #### public boolean isBasicCollectionType()

    - #### public boolean isBidirectional()

    - #### @java.lang.SuppressWarnings("unchecked") public boolean isCircular()

    - #### public boolean isDerived()

    - #### public boolean isEmbedded()

    - #### public boolean isEnum()

    - #### public boolean isExplicitSaveUpdateCascade()

    - #### public boolean isHasOne()

      Returns:
        true if the foreign key in a one-to-one is stored in the parent

    - #### public boolean isIdentity()

    - #### public boolean isInherited()

    - #### public boolean isManyToMany()

    - #### public boolean isManyToOne()

    - #### public boolean isOneToMany()

    - #### public boolean isOneToOne()

    - #### public boolean isOptional()

    - #### public boolean isOwningSide()

    - #### public boolean isPersistent()

    - #### public void setBasicCollectionType(boolean b)

    - #### protected void setBidirectional(boolean bidirectional)

      Sets whether the relationship is bidirectional or not

    - #### public void setDerived(boolean derived)

    - #### public void setEmbedded(boolean isEmbedded)

    - #### public void setExplicitSaveUpdateCascade(boolean explicitSaveUpdateCascade)

    - #### protected void setHasOne(boolean isHasOne)

      Set whether the foreign key is stored in the parent or child in a one-to-one

      Parameters:
        `isHasOne` - True if its stored in the parent

    - #### public void setIdentity(boolean b)

    - #### protected void setManyToMany(boolean manyToMany)

      Parameters:
        `manyToMany` - The manyToMany to set.

    - #### protected void setManyToOne(boolean manyToOne)

      Parameters:
        `manyToOne` - The manyToOne to set.

    - #### protected void setOneToMany(boolean oneToMany)

      Parameters:
        `oneToMany` - The oneToMany to set.

    - #### protected void setOneToOne(boolean oneToOne)

      Parameters:
        `oneToOne` - The oneToOne to set.

    - #### public void setOtherSide(GrailsDomainClassProperty property)

    - #### public void setOwningSide(boolean b)

    - #### protected void setPersistent(boolean persistent)

      Parameters:
        `persistent` - The persistant to set.

    - #### public void setReferencePropertyName(java.lang.String name)

    - #### public void setReferencedDomainClass(GrailsDomainClass referencedDomainClass)

    - #### protected void setReferencedPropertyType(java.lang.Class<?> referencedPropertyType)

      Sets the referenced property type of this property

    - #### @java.lang.Override public java.lang.String toString()