public class ObjAttribute extends Attribute implements ConfigurationNode
Modifier and Type | Field and Description |
---|---|
protected String |
dbAttributePath |
protected String |
type |
protected boolean |
usedForLocking |
Constructor and Description |
---|
ObjAttribute() |
ObjAttribute(ObjAttribute attribute)
Creates a clone of an ObjAttribute argument.
|
ObjAttribute(String name) |
ObjAttribute(String name,
String type,
ObjEntity entity) |
Modifier and Type | Method and Description |
---|---|
<T> T |
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.
|
String |
getDbAttributeName()
Returns the the name of the mapped DbAttribute.
|
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.
|
Iterator<CayenneMapEntry> |
getDbPathIterator() |
Iterator<CayenneMapEntry> |
getDbPathIterator(ObjEntity entity) |
ObjEntity |
getEntity()
Returns parent entity that holds this attribute.
|
Class<?> |
getJavaClass()
Returns Java class of an object property described by this attribute.
|
int |
getMaxLength()
Returns this attribute's maximum allowed length
|
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(String dbAttributePath) |
void |
setType(String type)
Sets the type of the data object property.
|
void |
setUsedForLocking(boolean usedForLocking)
Sets whether this attribute should be used for locking.
|
String |
toString() |
void |
updateDbAttributePath()
Updates DbAttributePath for this ObjAttribute
|
protected String type
protected boolean usedForLocking
protected String dbAttributePath
public ObjAttribute()
public ObjAttribute(String name)
public ObjAttribute(ObjAttribute attribute)
public ObjEntity getEntity()
Attribute
public <T> T acceptVisitor(ConfigurationNodeVisitor<T> visitor)
acceptVisitor
in interface ConfigurationNode
public Class<?> getJavaClass()
public void encodeAsXML(XMLEncoder encoder)
encodeAsXML
in interface XMLSerializable
encodeAsXML
in class Attribute
public String getType()
public void setType(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 Iterator<CayenneMapEntry> getDbPathIterator()
public Iterator<CayenneMapEntry> getDbPathIterator(ObjEntity entity)
public String getDbAttributeName()
public void setDbAttributePath(String dbAttributePath)
public String getDbAttributePath()
public boolean isFlattened()
public boolean isMandatory()
DbAttribute.isMandatory()
public int getMaxLength()
DbAttribute.getMaxLength()
public ObjAttribute getClientAttribute()
public void updateDbAttributePath()
Copyright © 2001–2018 Apache Cayenne. All rights reserved.