|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.common.BaseObject | +--oracle.jbo.server.NamedObjectImpl | +--oracle.jbo.server.DefObject | +--oracle.jbo.server.AttributeDefImpl
Describes properties exported by JavaBeans. An instance of this class describe a property that is accessible through get and set methods.
Field Summary | |
static byte |
ATTR_LOAD_BULK
|
static byte |
ATTR_LOAD_EACH
|
static byte |
ATTR_LOAD_SKIP
|
protected byte |
mAttrLoad
Attribute Loading |
protected java.lang.String |
mColumnName
Column name for the attribute |
protected oracle.jbo.server.RowDef |
mDef
Back Pointer to Def Object where the Attribute belongs |
protected java.lang.Object |
mDefaultValue
Deafult Value |
protected java.lang.Object |
mElemFactory
|
protected java.lang.Class |
mElemType
The Java Type Object |
protected int |
mIndex
Index in the Table |
protected java.lang.Class |
mJavaType
The Java Type Object |
protected byte |
mKind
Attribute kind : Transient, Dynamic etc |
protected boolean |
mMandatory
Does this attribute not allow null values |
protected boolean |
mNotNull
Is null or not |
protected boolean |
mObjectTableOID
Is OID present |
protected boolean |
mObjectTableRef
Does it have Object table ref |
protected java.lang.String |
mObjectType
Object Type |
protected java.lang.String[] |
mOIDAttrNames
|
protected int |
mPrecision
Precision Value , defualted to zero |
protected boolean |
mPrimaryKey
Is primary Key or not |
protected boolean |
mQueriable
Is queryable or not |
protected java.lang.reflect.Method |
mReadMethod
To keep the read method with this attribute |
protected boolean |
mRetrievedOnInsert
Is retrieved on Insert |
protected boolean |
mRetrievedOnUpdate
Is retrieved on update |
protected int |
mScale
Scale value for attribute set by default to 0 Its the number of decimal points before/after the decimal based on whether on whether the scale if positive or negative |
protected SQLBuilder |
mSQLBuilder
Handle to SQL Builder |
protected int |
mType
Attribute SQLtype |
protected java.lang.Object |
mTypeFactory
The CustomDatumFactory |
protected boolean |
mTypeFactoryInitialized
No factory Found |
protected byte |
mUpdateable
Is the attribute updatable |
protected java.lang.reflect.Method |
mWriteMethod
To keep the write method with this attribute |
Fields inherited from class oracle.jbo.server.DefObject |
mCompUsageList,
mCompUsages |
Fields inherited from class oracle.jbo.server.NamedObjectImpl |
mFullName,
mName,
mParent,
mProperties |
Fields inherited from class oracle.jbo.common.BaseObject |
TRACE_EVERY_ALLOC,
TRACE_NONE,
TRACE_OCCASIONAL,
TRACE_UNINITIALIZED |
Fields inherited from interface oracle.jbo.AttributeDef |
ATTR_ASSOCIATED_ROW,
ATTR_ASSOCIATED_ROWITERATOR,
ATTR_DYNAMIC,
ATTR_ENTITY_DERIVED,
ATTR_PERSISTENT,
ATTR_SQL_DERIVED,
ATTR_TRANSIENT,
READONLY,
UPDATEABLE,
UPDATEABLE_WHILE_NEW |
Constructor Summary | |
protected |
AttributeDefImpl()
Default constructor |
Method Summary | |
void |
beanToStore(java.lang.Object bean,
Row store)
|
java.lang.Object |
convertToJava(java.lang.Object data)
Converts a value from the database type to a Java type. |
java.lang.Object |
convertToStorage(java.lang.Object data,
DBTransactionImpl trans)
Converts a value from the attribute's Java type to a database type. |
byte |
getAttributeKind()
Gets the "kind" of this attribute. |
byte |
getAttrLoad()
Gets the attribute's load value. |
java.lang.String |
getColumnName()
Gets the column name of the attribute. |
java.lang.String |
getColumnNameForQuery()
Gets the column name to be used in query statement. |
oracle.jbo.server.RowDef |
getDef()
Gets the DefObject which describes this attribute. |
java.lang.Object |
getDefaultValue()
Gets the default value of the attribute. |
java.lang.Object |
getElemFactory()
|
java.lang.Class |
getElemType()
Gets the element type of the attribute. |
EntityDefImpl |
getEntityDef()
Gets the EntityDefImpl which contains this attribute. |
int |
getIndex()
Gets the column position of this attribute in the data source. |
java.lang.Class |
getJavaType()
Gets the Java type of the attribute. |
java.lang.String |
getName()
Gets the name of the attribute. |
java.lang.String |
getObjectType()
Gets the name of the attribute's type name. |
java.lang.String[] |
getOIDAttrNames()
|
int |
getPrecision()
Gets the attribute's precision. |
java.util.Hashtable |
getProperties()
Creates a table of this attribute's properties. |
java.lang.Object |
getProperty(java.lang.String hintName)
Retrieves the specified property, if available. |
int |
getScale()
Gets the attribute's scale value. |
protected SQLBuilder |
getSQLBuilder()
Get the SQLBuilderImpl - lazily building |
int |
getSQLType()
Gets the SQL type of this attribute. |
static java.lang.String |
getSQLTypeIdToString(int typeId)
Converts an identifier to the name of an SQL type. |
static int |
getSQLTypeStringToId(java.lang.String sqlType)
Converts a SQL type name to its identifier. |
java.lang.Object |
getTypeFactory()
|
byte |
getUpdateableFlag()
Tests if this attribute is updateable. |
boolean |
isMandatory()
Tests if an attribute is not null. |
boolean |
isObjectTableOID()
|
boolean |
isObjectTableRef()
|
boolean |
isPrimaryKey()
Tests if this attribute is a Primary Key. |
boolean |
isQueriable()
Tests if this attribute can be queried. |
boolean |
isRetrievedOnInsert()
Tests if the attribute is retrieved after a row is inserted. |
boolean |
isRetrievedOnUpdate()
Tests if the attribute is retrieved after a row is updated. |
java.lang.Object |
loadFromResultSet(java.sql.ResultSet rs,
int index,
DBTransactionImpl trans)
|
java.lang.Object |
loadFromStatement(java.sql.PreparedStatement cs,
int index,
Transaction trans)
|
void |
storeToBean(java.lang.Object bean,
Row store)
|
Methods inherited from class oracle.jbo.server.DefObject |
getPackageDef,
getPackageName,
isObjectResolved |
Methods inherited from class oracle.jbo.server.NamedObjectImpl |
getFullName,
getParent,
getPropertiesAsStrings,
setFullName,
setProperty |
Methods inherited from class oracle.jbo.common.BaseObject |
dumpState,
setTraceLevel,
setTraceWriter |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final byte ATTR_LOAD_EACH
public static final byte ATTR_LOAD_BULK
public static final byte ATTR_LOAD_SKIP
protected java.lang.String mColumnName
protected boolean mQueriable
protected boolean mPrimaryKey
protected boolean mMandatory
protected boolean mRetrievedOnInsert
protected boolean mRetrievedOnUpdate
protected oracle.jbo.server.RowDef mDef
protected boolean mObjectTableRef
protected boolean mObjectTableOID
protected java.lang.String[] mOIDAttrNames
protected java.lang.String mObjectType
protected boolean mNotNull
protected int mPrecision
protected int mScale
protected byte mUpdateable
protected byte mKind
protected byte mAttrLoad
protected int mType
protected int mIndex
protected java.lang.Object mDefaultValue
protected java.lang.Class mJavaType
protected java.lang.Class mElemType
protected java.lang.reflect.Method mReadMethod
protected java.lang.reflect.Method mWriteMethod
protected java.lang.Object mTypeFactory
protected java.lang.Object mElemFactory
protected boolean mTypeFactoryInitialized
protected SQLBuilder mSQLBuilder
Constructor Detail |
protected AttributeDefImpl()
Method Detail |
public java.lang.String getName()
public boolean isQueriable()
Queriable attributes are those attributes that may have a filter condition for the WHERE clause. If this method returns false, the attribute will not be used in constructing the WHERE clause of the SQL statement.
public byte getUpdateableFlag()
public boolean isPrimaryKey()
public boolean isRetrievedOnInsert()
Some derived attributes need to be re-fetched after a save operation has been performed. These typically include timestamps, computed fields, virtual columns and Oracle ROWIDs and OIDs.
public boolean isRetrievedOnUpdate()
Some derived attributes need to be re-fetched after a save operation has been performed. These typically include timestamps, computed fields, virtual columns and Oracle ROWIDs and OIDs.
public boolean isMandatory()
public boolean isObjectTableRef()
public boolean isObjectTableOID()
public java.lang.String[] getOIDAttrNames()
public java.lang.String getObjectType()
public int getPrecision()
For strings, precision is maximum allowed length. For numeric values, precision is the number of significant digits.
public int getScale()
Scale value is meaningful only for numeric attributes.
public EntityDefImpl getEntityDef()
public oracle.jbo.server.RowDef getDef()
public int getIndex()
public int getSQLType()
public byte getAttributeKind()
public byte getAttrLoad()
public java.lang.Class getJavaType()
Subclasses should override this method because entities with no accessors should also be able to get their types from attribute descriptors and beans.
public java.lang.Class getElemType()
Element type is relevant only if the attribute is an array attribute.
public java.lang.Object getDefaultValue()
The default value for an attribute is expressed in terms of the Java type system, rather than the storage type system.
public java.lang.String getColumnName()
public java.lang.String getColumnNameForQuery()
public java.lang.Object convertToJava(java.lang.Object data) throws DataCreationException
This method uses AttributeDefImpl() metadata to convert a database value to the corresponding Java value.
data
- a storage value to be converted.public java.lang.Object getTypeFactory()
public java.lang.Object getElemFactory()
public java.lang.Object loadFromResultSet(java.sql.ResultSet rs, int index, DBTransactionImpl trans) throws DataCreationException
public java.lang.Object loadFromStatement(java.sql.PreparedStatement cs, int index, Transaction trans) throws DataCreationException
public java.lang.Object convertToStorage(java.lang.Object data, DBTransactionImpl trans)
This method uses AttributeDefImpl() metadata to convert a Java value to the corresponding database value.
data
- a Java value to be converted.trans
- public static int getSQLTypeStringToId(java.lang.String sqlType)
sqlType
- the name of a SQL datatype.JboTypeMap
public static java.lang.String getSQLTypeIdToString(int typeId)
typeID
- an SQL type identifier.JboTypeMap
public java.lang.Object getProperty(java.lang.String hintName)
hintName
- the property's key.public java.util.Hashtable getProperties()
protected SQLBuilder getSQLBuilder()
public void storeToBean(java.lang.Object bean, Row store)
public void beanToStore(java.lang.Object bean, Row store)
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |