org.apache.cayenne.map
Class ObjAttribute

java.lang.Object
  extended by org.apache.cayenne.map.Attribute
      extended by org.apache.cayenne.map.ObjAttribute
All Implemented Interfaces:
java.io.Serializable, CayenneMapEntry, XMLSerializable
Direct Known Subclasses:
EOObjAttribute

public class ObjAttribute
extends Attribute

An ObjAttribute is a mapping descriptor of a Java class property.

Author:
Misha Shengaout, Andrei Adamchik
See Also:
Serialized Form

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(java.lang.String name)
           
ObjAttribute(java.lang.String name, java.lang.String type, ObjEntity entity)
           
 
Method Summary
 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 dbAttributeName.
 java.lang.String getDbAttributePath()
           
 java.util.Iterator getDbPathIterator()
           
 java.lang.Class getJavaClass()
          Returns Java class of an object property described by this attribute.
 java.lang.String getType()
          Returns fully qualified Java class name of the object property represented by this attribute.
 boolean isCompound()
           
 boolean isUsedForLocking()
          Returns whether this attribute should be used for locking.
 boolean mapsToDependentDbEntity()
          Deprecated. Since 1.2 unused.
 void setDbAttribute(DbAttribute dbAttribute)
          Set mapped DbAttribute.
 void setDbAttributeName(java.lang.String dbAttributeName)
          Sets the dbAttributeName.
 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 validate()
          Deprecated. Since 1.2 unused.
 
Methods inherited from class org.apache.cayenne.map.Attribute
getEntity, getName, getParent, setEntity, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected java.lang.String type

usedForLocking

protected boolean usedForLocking

dbAttributePath

protected java.lang.String dbAttributePath
Constructor Detail

ObjAttribute

public ObjAttribute()

ObjAttribute

public ObjAttribute(java.lang.String name)

ObjAttribute

public ObjAttribute(java.lang.String name,
                    java.lang.String type,
                    ObjEntity entity)
Method Detail

getJavaClass

public java.lang.Class getJavaClass()
Returns Java class of an object property described by this attribute. Wraps any thrown exceptions into CayenneRuntimeException.


encodeAsXML

public void encodeAsXML(XMLEncoder encoder)
Prints itself as XML to the provided XMLEncoder.

Since:
1.1

getType

public java.lang.String getType()
Returns fully qualified Java class name of the object property represented by this attribute.


setType

public void setType(java.lang.String type)
Sets the type of the data object property. Type is expected to be a fully qualified Java class name.


isUsedForLocking

public boolean isUsedForLocking()
Returns whether this attribute should be used for locking.

Since:
1.1

setUsedForLocking

public void setUsedForLocking(boolean usedForLocking)
Sets whether this attribute should be used for locking.

Since:
1.1

getDbAttribute

public DbAttribute getDbAttribute()
Returns a DbAttribute mapped by this ObjAttribute.


getDbPathIterator

public java.util.Iterator getDbPathIterator()

setDbAttribute

public void setDbAttribute(DbAttribute dbAttribute)
Set mapped DbAttribute.


getDbAttributeName

public java.lang.String getDbAttributeName()
Returns the dbAttributeName.

Returns:
String

setDbAttributeName

public void setDbAttributeName(java.lang.String dbAttributeName)
Sets the dbAttributeName.

Parameters:
dbAttributeName - The dbAttributeName to set

setDbAttributePath

public void setDbAttributePath(java.lang.String dbAttributePath)

getDbAttributePath

public java.lang.String getDbAttributePath()

isCompound

public boolean isCompound()

mapsToDependentDbEntity

public boolean mapsToDependentDbEntity()
Deprecated. Since 1.2 unused.


validate

public void validate()
              throws CayenneException
Deprecated. Since 1.2 unused.

Throws:
CayenneException

getClientAttribute

public ObjAttribute getClientAttribute()
Returns an ObjAttribute stripped of any server-side information, such as DbAttribute mapping.

Since:
1.2


Copyright © 2001-2006 Apache.org All Rights Reserved.