Class EmbeddedAttribute
java.lang.Object
org.apache.cayenne.map.Attribute<ObjEntity, ObjAttribute, ObjRelationship>
org.apache.cayenne.map.ObjAttribute
org.apache.cayenne.map.EmbeddedAttribute
- All Implemented Interfaces:
Serializable, ConfigurationNode, CayenneMapEntry, XMLSerializable
An attribute of the ObjEntity that maps to an embeddable class.
- Since:
- 3.0
- See Also:
-
Field Summary
FieldsFields inherited from class ObjAttribute
dbAttributePath, lazy, type, usedForLockingModifier and TypeFieldDescriptionprotected CayennePathprotected booleanprotected Stringprotected booleanFields inherited from class Attribute
entity, nameModifier and TypeFieldDescriptionprotected Entity<ObjEntity, ObjAttribute, ObjRelationship> protected String -
Constructor Summary
ConstructorsConstructorDescriptionEmbeddedAttribute(String name) EmbeddedAttribute(String name, String type, ObjEntity entity) Copying constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttributeOverride(String name, String dbAttributeName) voidencodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate) Prints itself as XML to the provided XMLEncoder.getAttribute(String name) Returns an ObjAttribute for a given name, taking into account column name overrides.getAttributeForDbPath(String dbPath) Returns an ObjAttribute that maps to a givenDbAttribute, or returns null if no such attribute exists.Returns a Collection of ObjAttributes of an embedded object taking into account column name overrides.Class<?> Returns Java class of an object property described by this attribute.getType()Returns a type of this attribute that must be anEmbeddableobject.voidvoidSets a type of this attribute that must be anEmbeddableobject.Methods inherited from class ObjAttribute
acceptVisitor, getDbAttribute, getDbAttributeName, getDbAttributePath, getDbPathIterator, getDbPathIterator, getEntity, getMaxLength, isFlattened, isInherited, isLazy, isMandatory, isPrimaryKey, isUsedForLocking, setDbAttributePath, setDbAttributePath, setLazy, setUsedForLocking, toString, updateDbAttributePathModifier and TypeMethodDescription<T> TacceptVisitor(ConfigurationNodeVisitor<T> visitor) Returns a DbAttribute mapped by this ObjAttribute.Returns the name of the mapped DbAttribute.Returns a dot-separated path that starts in the root DbEntity that maps to this attribute's ObjEntity and spans zero or more relationships, always ending in a DbAttribute name.getDbPathIterator(ObjEntity entity) Returns parent entity that holds this attribute.intReturns this attribute's maximum allowed lengthbooleanReturns whether this attribute is "flattened", meaning that it points to a column from an entity other than the DbEntity mapped to the parent ObjEntity.booleanReturnstrueif attribute inherited from a super entity.booleanisLazy()booleanReturns whether this attribute is mandatorybooleanbooleanReturns whether this attribute should be used for locking.voidsetDbAttributePath(String dbAttributePath) voidsetDbAttributePath(CayennePath dbAttributePath) voidsetLazy(boolean lazy) Sets whether this attribute should be loaded lazily.voidsetUsedForLocking(boolean usedForLocking) Sets whether this attribute should be used for locking.toString()voidUpdates DbAttributePath for this ObjAttributeMethods inherited from class Attribute
getName, getParent, setEntity, setName, setParentModifier and TypeMethodDescriptiongetName()Returns the name property of this object.Returns the parent map.voidsetEntity(Entity<ObjEntity, ObjAttribute, ObjRelationship> entity) Sets parent entity that holds this attribute.voidvoidStores the parent map.
-
Field Details
-
attributeOverrides
-
-
Constructor Details
-
EmbeddedAttribute
public EmbeddedAttribute() -
EmbeddedAttribute
-
EmbeddedAttribute
-
EmbeddedAttribute
Copying constructor- Parameters:
other- attribute to copy- Since:
- 4.2
-
-
Method Details
-
encodeAsXML
Description copied from class:ObjAttributePrints itself as XML to the provided XMLEncoder.- Specified by:
encodeAsXMLin interfaceXMLSerializable- Overrides:
encodeAsXMLin classObjAttribute
-
getAttributeOverrides
-
getEmbeddable
-
getAttributeForDbPath
Returns an ObjAttribute that maps to a givenDbAttribute, or returns null if no such attribute exists. -
getAttribute
Returns an ObjAttribute for a given name, taking into account column name overrides. -
getAttributes
Returns a Collection of ObjAttributes of an embedded object taking into account column name overrides. -
addAttributeOverride
-
removeAttributeOverride
-
getType
Returns a type of this attribute that must be anEmbeddableobject.- Overrides:
getTypein classObjAttribute
-
getJavaClass
Returns Java class of an object property described by this attribute. Wraps any thrown exceptions into CayenneRuntimeException.- Overrides:
getJavaClassin classObjAttribute
-
setType
Sets a type of this attribute that must be anEmbeddableobject.- Overrides:
setTypein classObjAttribute
-