Package org.apache.cayenne.map
Class ObjAttribute
java.lang.Object
org.apache.cayenne.map.Attribute
org.apache.cayenne.map.ObjAttribute
- All Implemented Interfaces:
- Serializable,- ConfigurationNode,- CayenneMapEntry,- XMLSerializable
- Direct Known Subclasses:
- EmbeddedAttribute
public class ObjAttribute extends Attribute implements ConfigurationNode
An ObjAttribute is a mapping descriptor of a Java class property.
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description protected StringdbAttributePathprotected Stringtypeprotected booleanusedForLocking
- 
Constructor SummaryConstructors Constructor Description ObjAttribute()ObjAttribute(String name)ObjAttribute(String name, String type, ObjEntity entity)ObjAttribute(ObjAttribute attribute)Creates a clone of an ObjAttribute argument.
- 
Method SummaryModifier and Type Method Description <T> TacceptVisitor(ConfigurationNodeVisitor<T> visitor)voidencodeAsXML(XMLEncoder encoder, ConfigurationNodeVisitor delegate)Prints itself as XML to the provided XMLEncoder.ObjAttributegetClientAttribute()Returns an ObjAttribute stripped of any server-side information, such as DbAttribute mapping.DbAttributegetDbAttribute()Returns a DbAttribute mapped by this ObjAttribute.StringgetDbAttributeName()Returns the the name of the mapped DbAttribute.StringgetDbAttributePath()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.Iterator<CayenneMapEntry>getDbPathIterator()Iterator<CayenneMapEntry>getDbPathIterator(ObjEntity entity)ObjEntitygetEntity()Returns parent entity that holds this attribute.Class<?>getJavaClass()Returns Java class of an object property described by this attribute.intgetMaxLength()Returns this attribute's maximum allowed lengthStringgetType()Returns fully qualified Java class name of the object property represented by this attribute.booleanisFlattened()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.booleanisInherited()Returnstrueif attribute inherited from a super entity.booleanisMandatory()Returns whether this attribute is mandatorybooleanisPrimaryKey()booleanisUsedForLocking()Returns whether this attribute should be used for locking.voidsetDbAttributePath(String dbAttributePath)voidsetType(String type)Sets the type of the data object property.voidsetUsedForLocking(boolean usedForLocking)Sets whether this attribute should be used for locking.StringtoString()voidupdateDbAttributePath()Updates DbAttributePath for this ObjAttribute
- 
Field Details- 
type
- 
usedForLockingprotected boolean usedForLocking
- 
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.
- 
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
- 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
 
- 
getDbAttributeReturns a DbAttribute mapped by this ObjAttribute.
- 
isInheritedpublic boolean isInherited()Returnstrueif attribute inherited from a super entity.- Since:
- 3.0
 
- 
getDbPathIterator
- 
getDbPathIterator
- 
getDbAttributeNameReturns the the name of the mapped DbAttribute. This value is the same as "dbAttributePath" for regular attributes mapped to columns. It is equql to the last path component for the flattened attributes.
- 
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:
- DbAttribute.isMandatory()
 
- 
getMaxLengthpublic int getMaxLength()Returns this attribute's maximum allowed length- See Also:
- DbAttribute.getMaxLength()
 
- 
getClientAttributeReturns an ObjAttribute stripped of any server-side information, such as DbAttribute mapping.- Since:
- 1.2
 
- 
updateDbAttributePathpublic void updateDbAttributePath()Updates DbAttributePath for this ObjAttribute
- 
toString
 
-