|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.map.Attribute
org.apache.cayenne.map.ObjAttribute
public class ObjAttribute
An ObjAttribute is a mapping descriptor of a Java class property.
Field Summary | |
---|---|
protected java.lang.String |
dbAttributePath
|
protected java.lang.String |
type
|
protected boolean |
usedForLocking
|
Fields inherited from class org.apache.cayenne.map.Attribute |
---|
entity, name |
Constructor Summary | |
---|---|
ObjAttribute()
|
|
ObjAttribute(ObjAttribute attribute)
Creates a clone of an ObjAttribute argument. |
|
ObjAttribute(java.lang.String name)
|
|
ObjAttribute(java.lang.String name,
java.lang.String type,
ObjEntity entity)
|
Method Summary | ||
---|---|---|
|
acceptVisitor(ConfigurationNodeVisitor<T> visitor)
|
|
void |
encodeAsXML(XMLEncoder encoder)
Prints itself as XML to the provided XMLEncoder. |
|
ObjAttribute |
getClientAttribute()
Returns an ObjAttribute stripped of any server-side information, such as DbAttribute mapping. |
|
DbAttribute |
getDbAttribute()
Returns a DbAttribute mapped by this ObjAttribute. |
|
java.lang.String |
getDbAttributeName()
Returns the the name of the mapped DbAttribute. |
|
java.lang.String |
getDbAttributePath()
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. |
|
java.util.Iterator<CayenneMapEntry> |
getDbPathIterator()
|
|
java.util.Iterator<CayenneMapEntry> |
getDbPathIterator(ObjEntity entity)
|
|
java.lang.Class<?> |
getJavaClass()
Returns Java class of an object property described by this attribute. |
|
int |
getMaxLength()
Returns this attribute's maximum allowed length |
|
java.lang.String |
getType()
Returns fully qualified Java class name of the object property represented by this attribute. |
|
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. |
|
boolean |
isInherited()
Returns true if attribute inherited from a super entity. |
|
boolean |
isMandatory()
Returns whether this attribute is mandatory |
|
boolean |
isPrimaryKey()
|
|
boolean |
isUsedForLocking()
Returns whether this attribute should be used for locking. |
|
void |
setDbAttributePath(java.lang.String dbAttributePath)
|
|
void |
setType(java.lang.String type)
Sets the type of the data object property. |
|
void |
setUsedForLocking(boolean usedForLocking)
Sets whether this attribute should be used for locking. |
|
void |
updateDbAttributePath()
Updates DbAttributePath for this ObjAttribute |
Methods inherited from class org.apache.cayenne.map.Attribute |
---|
getEntity, getName, getParent, setEntity, setName, setParent, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String type
protected boolean usedForLocking
protected java.lang.String dbAttributePath
Constructor Detail |
---|
public ObjAttribute()
public ObjAttribute(java.lang.String name)
public ObjAttribute(java.lang.String name, java.lang.String type, ObjEntity entity)
public ObjAttribute(ObjAttribute attribute)
Method Detail |
---|
public <T> T acceptVisitor(ConfigurationNodeVisitor<T> visitor)
acceptVisitor
in interface ConfigurationNode
public java.lang.Class<?> getJavaClass()
public void encodeAsXML(XMLEncoder encoder)
encodeAsXML
in interface XMLSerializable
encodeAsXML
in class Attribute
public java.lang.String getType()
public void setType(java.lang.String type)
public boolean isPrimaryKey()
public boolean isUsedForLocking()
public void setUsedForLocking(boolean usedForLocking)
public DbAttribute getDbAttribute()
public boolean isInherited()
true
if attribute inherited from a super entity.
public java.util.Iterator<CayenneMapEntry> getDbPathIterator()
public java.util.Iterator<CayenneMapEntry> getDbPathIterator(ObjEntity entity)
public java.lang.String getDbAttributeName()
public void setDbAttributePath(java.lang.String dbAttributePath)
public java.lang.String getDbAttributePath()
public boolean isFlattened()
public boolean isMandatory()
DbAttribute.isMandatory()
public int getMaxLength()
DbAttribute.getMaxLength()
public ObjAttribute getClientAttribute()
public void updateDbAttributePath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |