|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.metadata.AttributeDescriptorBase
org.apache.ojb.broker.metadata.FieldDescriptor
public class FieldDescriptor
A FieldDescriptor holds the mapping information for a specific member-variable
of a persistent object.
Note: Be careful when use references of this class or caching instances of this class,
because instances could become invalid (see MetadataManager
).
Field Summary | |
---|---|
static java.lang.String |
ACCESS_ANONYMOUS
|
static java.lang.String |
ACCESS_READONLY
|
static java.lang.String |
ACCESS_READWRITE
|
Constructor Summary | |
---|---|
FieldDescriptor(ClassDescriptor cld,
int id)
Constructor declaration |
Method Summary | |
---|---|
void |
addAttribute(java.lang.String attributeName,
java.lang.String attributeValue)
Store the specified attribute and it's value. |
java.lang.Object |
clone()
|
java.lang.String |
getAccess()
|
java.lang.String |
getAttribute(java.lang.String attributeName)
Get the value of an attribute |
java.lang.String |
getAttribute(java.lang.String attributeName,
java.lang.String defaultValue)
Get the value of an attribute |
java.lang.String[] |
getAttributeNames()
Returns an array of the names of all atributes of this descriptor. |
java.util.Map |
getAttributes()
Returns the attribute map (name, value) of this descriptor. |
int |
getColNo()
|
java.lang.String |
getColumnName()
|
java.lang.String |
getColumnType()
|
static java.util.Comparator |
getComparator()
returns a comparator that allows to sort a Vector of FieldMappingDecriptors according to their m_Order entries. |
FieldConversion |
getFieldConversion()
Gets the fieldConversion. |
java.lang.String |
getFullColumnName()
Answer the qualified ColumnName ie: myTab.name |
JdbcType |
getJdbcType()
Returns the corresponding database JdbcType ) of this field,
defined by the JDBC 3.0 specification, e.g. |
int |
getLength()
|
int |
getPrecision()
|
int |
getScale()
|
java.lang.String |
getSequenceName()
|
boolean |
isAccessReadOnly()
|
boolean |
isAnonymous()
Returns true if this field is declared as anonymous field. |
boolean |
isAutoIncrement()
|
boolean |
isIndexed()
|
boolean |
isLengthSpecified()
|
boolean |
isLocking()
Gets the locking. |
boolean |
isPrecisionSpecified()
|
boolean |
isPrimaryKey()
|
boolean |
isRequired()
|
boolean |
isScaleSpecified()
|
boolean |
isUpdateLock()
Gets the updateLock updateLock controls whether the lock fields should be updated by OJB when a row is saved If false then the dbms needs to update the lock fields. |
void |
setAccess(java.lang.String access)
|
void |
setAutoIncrement(boolean autoIncrement)
|
void |
setColumnName(java.lang.String str)
|
void |
setColumnType(java.lang.String str)
|
void |
setFieldConversion(FieldConversion fieldConversion)
Deprecated. use setFieldConversionClassName instead |
void |
setFieldConversionClassName(java.lang.String fieldConversionClassName)
Sets the fieldConversion. |
void |
setIndexed(boolean indexed)
|
void |
setLength(int length)
|
void |
setLengthSpecified(boolean lengthSpecified)
|
void |
setLocking(boolean locking)
Sets the locking. |
void |
setPrecision(int precision)
|
void |
setPrecisionSpecified(boolean precisionSpecified)
|
void |
setPrimaryKey(boolean b)
|
void |
setRequired(boolean required)
|
void |
setScale(int scale)
|
void |
setScaleSpecified(boolean scaleSpecified)
|
void |
setSequenceName(java.lang.String sequenceName)
|
void |
setUpdateLock(boolean updateLock)
Sets the updateLock updateLock controls whether the lock fields should be updated by OJB when a row is saved. |
java.lang.String |
toString()
Returns a string representation of this class. |
java.lang.String |
toXML()
returns the XML marshalled version of this instance. |
Methods inherited from class org.apache.ojb.broker.metadata.AttributeDescriptorBase |
---|
getAttributeName, getClassDescriptor, getPersistentField, setClassDescriptor, setPersistentField, setPersistentField |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ACCESS_ANONYMOUS
public static final java.lang.String ACCESS_READONLY
public static final java.lang.String ACCESS_READWRITE
Constructor Detail |
---|
public FieldDescriptor(ClassDescriptor cld, int id)
cld
- The parent ClassDescriptor
id
- A field id - unique against all other fields in the ClassDescriptor
Method Detail |
---|
public static java.util.Comparator getComparator()
public java.lang.String getColumnName()
public java.lang.String getFullColumnName()
public void setColumnName(java.lang.String str)
public java.lang.String getColumnType()
public void setColumnType(java.lang.String str)
public JdbcType getJdbcType()
JdbcType
) of this field,
defined by the JDBC 3.0 specification, e.g. VARCHAR, VARBINARY ...
The complement class is FieldType
) which manage the java field
type, e.g. a String, byte[] ...
Returns the mapped jdbc type of this field (see complement FieldType
), defined by
the JDBC specification.
public java.lang.String toString()
toString
in class AttributeDescriptorBase
public FieldConversion getFieldConversion()
public void setFieldConversion(FieldConversion fieldConversion)
fieldConversion
- The fieldConversion to setpublic void setFieldConversionClassName(java.lang.String fieldConversionClassName)
fieldConversionClassName
- The fieldConversion to setpublic boolean isIndexed()
public void setIndexed(boolean indexed)
public boolean isAutoIncrement()
public void setAutoIncrement(boolean autoIncrement)
public java.lang.String getSequenceName()
public void setSequenceName(java.lang.String sequenceName)
public boolean isPrimaryKey()
public void setPrimaryKey(boolean b)
public int getColNo()
public boolean isLocking()
public void setLocking(boolean locking)
locking
- The locking to setpublic boolean isUpdateLock()
public void setUpdateLock(boolean updateLock)
updateLock
- The updateLock to setpublic void setLength(int length)
public int getLength()
public void setPrecision(int precision)
public int getPrecision()
public void setScale(int scale)
public int getScale()
public boolean isRequired()
public void setRequired(boolean required)
public boolean isScaleSpecified()
public void setScaleSpecified(boolean scaleSpecified)
public boolean isPrecisionSpecified()
public void setPrecisionSpecified(boolean precisionSpecified)
public boolean isLengthSpecified()
public void setLengthSpecified(boolean lengthSpecified)
public java.lang.String getAccess()
public void setAccess(java.lang.String access)
public boolean isAccessReadOnly()
public boolean isAnonymous()
public java.lang.String toXML()
XmlCapable
toXML
in interface XmlCapable
public java.lang.Object clone()
clone
in class java.lang.Object
public void addAttribute(java.lang.String attributeName, java.lang.String attributeValue)
AttributeContainer
addAttribute
in interface AttributeContainer
attributeName
- the name of the attribute to retrieveattributeValue
- the attribute's valueAttributeContainer.addAttribute(String, String)
public java.lang.String getAttribute(java.lang.String attributeName, java.lang.String defaultValue)
AttributeContainer
getAttribute
in interface AttributeContainer
attributeName
- the attribute to retrievedefaultValue
- the value to return if the attribute is not present
AttributeContainer.getAttribute(String, String)
public java.lang.String getAttribute(java.lang.String attributeName)
AttributeContainer
getAttribute
in interface AttributeContainer
attributeName
- the attribute to retrieve
AttributeContainer.getAttribute(String)
public java.util.Map getAttributes()
public java.lang.String[] getAttributeNames()
null
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |