Class EmbeddedAttribute

All Implemented Interfaces:
Serializable, ConfigurationNode, CayenneMapEntry, XMLSerializable

public class EmbeddedAttribute extends ObjAttribute
An attribute of the ObjEntity that maps to an embeddable class.
Since:
3.0
See Also:
  • Field Details

  • Constructor Details

    • EmbeddedAttribute

      public EmbeddedAttribute()
    • EmbeddedAttribute

      public EmbeddedAttribute(String name)
    • EmbeddedAttribute

      public EmbeddedAttribute(String name, String type, ObjEntity entity)
    • EmbeddedAttribute

      public EmbeddedAttribute(EmbeddedAttribute other)
      Copying constructor
      Parameters:
      other - attribute to copy
      Since:
      4.2
  • Method Details

    • encodeAsXML

      public void encodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate)
      Description copied from class: ObjAttribute
      Prints itself as XML to the provided XMLEncoder.
      Specified by:
      encodeAsXML in interface XMLSerializable
      Overrides:
      encodeAsXML in class ObjAttribute
    • getAttributeOverrides

      public Map<String,String> getAttributeOverrides()
    • getEmbeddable

      public Embeddable getEmbeddable()
    • getAttributeForDbPath

      public ObjAttribute getAttributeForDbPath(String dbPath)
      Returns an ObjAttribute that maps to a given DbAttribute, or returns null if no such attribute exists.
    • getAttribute

      public ObjAttribute getAttribute(String name)
      Returns an ObjAttribute for a given name, taking into account column name overrides.
    • getAttributes

      public Collection<ObjAttribute> getAttributes()
      Returns a Collection of ObjAttributes of an embedded object taking into account column name overrides.
    • addAttributeOverride

      public void addAttributeOverride(String name, String dbAttributeName)
    • removeAttributeOverride

      public void removeAttributeOverride(String name)
    • getType

      public String getType()
      Returns a type of this attribute that must be an Embeddable object.
      Overrides:
      getType in class ObjAttribute
    • getJavaClass

      public Class<?> getJavaClass()
      Returns Java class of an object property described by this attribute. Wraps any thrown exceptions into CayenneRuntimeException.
      Overrides:
      getJavaClass in class ObjAttribute
    • setType

      public void setType(String type)
      Sets a type of this attribute that must be an Embeddable object.
      Overrides:
      setType in class ObjAttribute