Package org.apache.cayenne.map
Class ObjAttribute
java.lang.Object
org.apache.cayenne.map.Attribute<ObjEntity,ObjAttribute,ObjRelationship>
  
org.apache.cayenne.map.ObjAttribute
- All Implemented Interfaces:
- Serializable,- ConfigurationNode,- CayenneMapEntry,- XMLSerializable
- Direct Known Subclasses:
- EmbeddedAttribute
public class ObjAttribute
extends Attribute<ObjEntity,ObjAttribute,ObjRelationship>
implements ConfigurationNode  
An ObjAttribute is a mapping descriptor of a Java class property.
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected CayennePathprotected booleanprotected Stringprotected boolean
- 
Constructor SummaryConstructorsConstructorDescriptionObjAttribute(String name) ObjAttribute(String name, String type, ObjEntity entity) ObjAttribute(ObjAttribute attribute) Creates a clone of an ObjAttribute argument.
- 
Method SummaryModifier and TypeMethodDescription<T> TacceptVisitor(ConfigurationNodeVisitor<T> visitor) voidencodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor<?> delegate) Prints itself as XML to the provided XMLEncoder.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.Class<?>Returns Java class of an object property described by this attribute.intReturns this attribute's maximum allowed lengthgetType()Returns fully qualified Java class name of the object property represented by this attribute.booleanReturns 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.voidSets the type of the data object property.voidsetUsedForLocking(boolean usedForLocking) Sets whether this attribute should be used for locking.toString()voidUpdates DbAttributePath for this ObjAttribute
- 
Field Details- 
type
- 
usedForLockingprotected boolean usedForLocking
- 
lazyprotected boolean lazy- Since:
- 4.2
 
- 
dbAttributePath
 
- 
- 
Constructor Details- 
ObjAttributepublic ObjAttribute()
- 
ObjAttribute
- 
ObjAttribute
- 
ObjAttributeCreates a clone of an ObjAttribute argument.- Since:
- 3.0
 
 
- 
- 
Method Details- 
getEntityDescription copied from class:AttributeReturns parent entity that holds this attribute.- Overrides:
- getEntityin class- Attribute<ObjEntity,- ObjAttribute, - ObjRelationship> 
 
- 
acceptVisitor- Specified by:
- acceptVisitorin interface- ConfigurationNode
- Since:
- 3.1
 
- 
getJavaClassReturns Java class of an object property described by this attribute. Wraps any thrown exceptions into CayenneRuntimeException.
- 
encodeAsXMLPrints itself as XML to the provided XMLEncoder.- Specified by:
- encodeAsXMLin interface- XMLSerializable
- Specified by:
- encodeAsXMLin class- Attribute<ObjEntity,- ObjAttribute, - ObjRelationship> 
- Since:
- 1.1
 
- 
getTypeReturns fully qualified Java class name of the object property represented by this attribute.
- 
setTypeSets the type of the data object property. Type is expected to be a fully qualified Java class name.
- 
isPrimaryKeypublic boolean isPrimaryKey()- Since:
- 3.0
 
- 
isUsedForLockingpublic boolean isUsedForLocking()Returns whether this attribute should be used for locking.- Since:
- 1.1
 
- 
setUsedForLockingpublic void setUsedForLocking(boolean usedForLocking) Sets whether this attribute should be used for locking.- Since:
- 1.1
 
- 
isLazypublic boolean isLazy()- Returns:
- whether this attribute should be loaded lazily.
- Since:
- 4.2
 
- 
setLazypublic void setLazy(boolean lazy) Sets whether this attribute should be loaded lazily.- Since:
- 4.2
 
- 
getDbAttributeReturns a DbAttribute mapped by this ObjAttribute.
- 
isInheritedpublic boolean isInherited()Returnstrueif attribute inherited from a super entity.- Since:
- 3.0
 
- 
getDbPathIterator
- 
getDbPathIterator
- 
getDbAttributeNameReturns the name of the mapped DbAttribute. This value is the same as "dbAttributePath" for regular attributes mapped to columns. It is equal to the last path component for the flattened attributes.
- 
setDbAttributePath
- 
setDbAttributePath
- 
getDbAttributePathReturns 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.
- 
isFlattenedpublic boolean isFlattened()Returns whether this attribute is "flattened", meaning that it points to a column from an entity other than the DbEntity mapped to the parent ObjEntity.- Since:
- 3.0
 
- 
isMandatorypublic boolean isMandatory()Returns whether this attribute is mandatory- See Also:
 
- 
getMaxLengthpublic int getMaxLength()Returns this attribute's maximum allowed length- See Also:
 
- 
updateDbAttributePathpublic void updateDbAttributePath()Updates DbAttributePath for this ObjAttribute
- 
toString- Overrides:
- toStringin class- Attribute<ObjEntity,- ObjAttribute, - ObjRelationship> 
 
 
-