org.apache.cayenne.map
Class EmbeddedAttribute

java.lang.Object
  extended by org.apache.cayenne.map.Attribute
      extended by org.apache.cayenne.map.EmbeddedAttribute
All Implemented Interfaces:
Serializable, CayenneMapEntry, XMLSerializable

public class EmbeddedAttribute
extends Attribute

An attribute of the ObjEntity that maps to an embeddable class.

Since:
3.0
Author:
Andrus Adamchik
See Also:
Serialized Form

Field Summary
protected  SortedMap attributeOverrides
           
protected  String type
           
 
Fields inherited from class org.apache.cayenne.map.Attribute
entity, name
 
Constructor Summary
EmbeddedAttribute()
           
EmbeddedAttribute(String name)
           
EmbeddedAttribute(String name, String type, ObjEntity entity)
           
 
Method Summary
 void addAttributeOverride(String name, String dbAttributeName)
           
 void encodeAsXML(XMLEncoder encoder)
          Prints itself as XML to the provided XMLEncoder.
 ObjAttribute getAttribute(String name)
          Returns an ObjAttribute for a given name, taking into account column name overrides.
 ObjAttribute getAttributeForDbPath(String dbPath)
          Returns an ObjAttribute that maps to a given DbAttribute, or returns null if no such attribute exists.
 Map getAttributeOverrides()
           
 Collection getAttributes()
          Returns a Collection of ObjAttributes of an embedded object taking into account column name overrides.
 Embeddable getEmbeddable()
           
 Class getJavaClass()
          Returns Java class of an object property described by this attribute.
 String getType()
          Returns a type of this attribute that must be an Embeddable object.
 void removeAttributeOverride(String name)
           
 void setType(String type)
          Sets a type of this attribute that must be an Embeddable object.
 
Methods inherited from class org.apache.cayenne.map.Attribute
getEntity, getName, getParent, setEntity, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected String type

attributeOverrides

protected SortedMap attributeOverrides
Constructor Detail

EmbeddedAttribute

public EmbeddedAttribute()

EmbeddedAttribute

public EmbeddedAttribute(String name)

EmbeddedAttribute

public EmbeddedAttribute(String name,
                         String type,
                         ObjEntity entity)
Method Detail

encodeAsXML

public void encodeAsXML(XMLEncoder encoder)
Description copied from interface: XMLSerializable
Prints itself as XML to the provided XMLEncoder.

Specified by:
encodeAsXML in interface XMLSerializable
Specified by:
encodeAsXML in class Attribute

getAttributeOverrides

public Map 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 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.


getJavaClass

public Class getJavaClass()
Returns Java class of an object property described by this attribute. Wraps any thrown exceptions into CayenneRuntimeException.


setType

public void setType(String type)
Sets a type of this attribute that must be an Embeddable object.



Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.