|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jbo.server.RowImpl
oracle.jbo.server.ViewRowImpl
public class ViewRowImpl
Field Summary | |
---|---|
static java.lang.Class |
CLASS_INSTANCE
|
Fields inherited from interface oracle.jbo.JboReservedVarNames |
---|
RESERVED_VAR_AGG_AVG, RESERVED_VAR_AGG_COUNT, RESERVED_VAR_AGG_MAX, RESERVED_VAR_AGG_MIN, RESERVED_VAR_AGG_SUM, RESERVED_VAR_AGGVAL_PREFIX, RESERVED_VAR_STRUCTURE_DEF |
Fields inherited from interface oracle.jbo.expr.JIReservedVarNames |
---|
RESERVED_VAR_VALUE |
Constructor Summary | |
---|---|
ViewRowImpl()
|
Method Summary | |
---|---|
protected void |
addEntityUsage(java.lang.String usageName,
EntityImpl entity)
Add an entity usage to this view row. |
protected void |
checkForOuterJoins()
Check the Entities in this View Row for Outer Joins. |
protected void |
clearAttributeException(int index)
Cleans any exception of an attribute of the given name was set earlier and threw an exception which was cached as the transaction is in deferred mode. |
protected void |
copyFrom(ViewRowImpl other)
For subclasses to implement copy of transient members in the subclass This method is invoked when a new row is created with attributes copied from the other row for move into a new collection in makeRowCopy. |
protected void |
create(AttributeList nvp)
Initialization method to be over-ridden in generated code for custom defaulting. |
protected ListBinding |
createListBinding(ListBindingDef lbDef,
RowSetIterator rsi)
Internal: Applications should not use this method. |
protected EntityImpl[] |
createMissingEntitiesFromViewDef(ViewDefImpl viewDef,
int[] eoIndices,
EntityImpl[] entities,
ResultSet resultSet,
AttributeList initValues,
boolean isNewRow,
ApplicationModule viewAccessorAM)
|
protected RowSet |
createViewAccessorRS(java.lang.String vaName)
Internal: Applications should not use this method. |
protected RowSet |
createViewAccessorRS(ViewAccessorDef va)
Internal: Applications should not use this method. |
void |
entityCacheAdd()
Populate the caches from the values of the rows. |
AttributeDef |
findAttributeDef(java.lang.String attrName)
|
protected java.lang.String |
findListBindingName(java.lang.String attrName,
java.lang.String lbName)
|
protected RowSetIterator |
findListBindingRSI(java.lang.String attrName,
java.lang.String lbName)
Internal: Applications should not use this method. |
protected ViewObject |
findOrCreateLocalViewObject(ViewAccessorDef vaDef)
Find or create the local view instance from the local view usage name. |
protected RowSet |
findOrCreateViewAccessorRS(ViewAccessorDef va)
Internal: Applications should not use this method. |
ViewAccessorDef |
findViewAccessorDef(java.lang.String name)
This method returns ViewAccessorDef with the specified name. |
ApplicationModule |
getApplicationModule()
Gets the Application Module to which the containing View Object belongs. |
protected ApplicationModule |
getApplicationModuleForViewAccessor()
Internal: Applications should not use this method. |
java.lang.Object |
getAttribute(int ix)
Get an attribute value by index |
java.lang.Object |
getAttribute(java.lang.String name)
Gets the value of an attribute by name. |
int |
getAttributeCount()
Gets the attribute count in this ViewRow. |
int |
getAttributeIndexOf(java.lang.String attrName)
Gets the index of the attribute, given it's name. |
protected java.lang.Object |
getAttributeInternal(int index)
Gets the value of the attribute by index. |
java.lang.String[] |
getAttributeNames()
Gets a list of the names of all attributes |
java.lang.Object[] |
getAttributeValues()
Gets a list of the values of all attributes |
protected java.lang.Object |
getAttrInvokeAccessor(int ix,
AttributeDefImpl attrRef)
|
EntityImpl[] |
getEntities()
Gets an array of Entity objects. |
EntityImpl |
getEntity(int index)
Gets the Entity at the given index. |
int |
getEntityCount()
Counts the number of Entity Objects in this row. |
protected EntityImpl |
getEntityForListBinding(java.lang.String eoName)
Method to retrieve the entity for locating entity level view accessor to be used in list binding. |
protected EntityImpl[] |
getEntityUsages()
|
java.lang.Object |
getHandle()
Creates a row identifier that is unique in the query collection. |
Key |
getKey()
Returns the identifier object for this row. |
protected RowSetIterator |
getListBindingRSI(ListBindingDef def)
Internal: Applications should not use this method. |
protected List |
getListBindings()
Internal: Applications should not use this method. |
RowSet |
getRowSet()
Internal: Applications should not use this method. |
StructureDef |
getStructureDef()
Returns the structure of the row. |
ViewDefImpl |
getViewDef()
Get the ViewDefImpl associated with this View Row. |
ViewObject |
getViewObject()
Gets the View Object to which this row belongs. |
protected void |
handleListBindingMismatch(ListBinding lb,
Map valuesMap,
RowIterator listRSI)
|
protected boolean |
hasListBindings()
|
protected void |
initDefaults()
|
boolean |
isAttributeUpdateable(int index)
Tests if an attribute is updateable. |
boolean |
isDead()
Tests this row to determine if it is dead |
boolean |
isTransientTransactionListener()
|
protected boolean |
isViewAccessorAttribute(int indexAttribute)
Check if an attribute is the attribute to store view accessor RowSetIterator. |
AttributeDef |
lookupAttributeDef(java.lang.String attrName)
|
protected void |
populate(ResultSet resultSet)
Internal: Applications should not use this method. |
protected void |
populateAttribute(int index,
java.lang.Object value)
The difference between this and setAttribute is that this does not check if the attribute is read-only, nor does it update the dirty bit. |
protected void |
populateAttribute(java.lang.String name,
java.lang.Object value)
|
protected void |
populateAttributeAsChanged(int index,
java.lang.Object value)
Internal Applications should not use this method. |
void |
refresh(int refreshMode)
Refreshes the row's attributes with values from database. |
protected void |
registerAttributeException(AttributeDef attrDef,
java.lang.Object val,
JboException dce)
|
void |
remove()
Deletes the row. |
protected void |
removeAllEntityUsages()
|
void |
removeAndRetain()
Removes the row from the collection and then retain it for insertion into another location. |
void |
removeFromCollection()
Removes the row from the collection. |
void |
revert()
Reverts this row back to its initial state |
void |
setAttribute(int index,
java.lang.Object val)
Sets an attribute. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets the value of an attribute by name. |
protected void |
setAttributeInternal(int index,
java.lang.Object val)
This is an "inner" accessor for an attribute and does not call out to the getXXX() method. |
void |
setAttributeValues(List names,
List values)
Set attribute values for the given list of attributes names. |
protected void |
setAttrInvokeAccessor(int index,
java.lang.Object val,
AttributeDefImpl attrRef)
|
protected void |
setEffectiveDateOnEntities()
Sets the Effective Date on the underlying entity rows. |
protected void |
setEntities(EntityImpl[] rows)
Sets the entities that this view row is composed of. |
void |
setNewRowState(byte state)
Sets a new unposted row, created in this transaction, to either STATUS_NEW or STATUS_INITIALIZED mode. |
void |
setTransientAttributeValue(ViewAttributeDefImpl vad,
java.lang.Object val)
|
protected boolean |
shouldAddViewAccessorRSToRow()
Internal: Applications should not use this method. |
boolean |
throwOnListBindingMismatch()
|
void |
validate()
Validates the row |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Class CLASS_INSTANCE
Constructor Detail |
---|
public ViewRowImpl()
Method Detail |
---|
protected void addEntityUsage(java.lang.String usageName, EntityImpl entity)
entity
- protected EntityImpl[] getEntityUsages()
protected void removeAllEntityUsages()
public final int getAttributeCount()
getAttributeCount
in interface AttributeList
getAttributeCount
in class RowImpl
public Key getKey()
getKey
in interface Row
getKey
in class RowImpl
public StructureDef getStructureDef()
RowImpl
getStructureDef
in interface Row
getStructureDef
in class RowImpl
public boolean isAttributeUpdateable(int index)
RowImpl
isAttributeUpdateable
in interface Row
isAttributeUpdateable
in class RowImpl
index
- the index of the attribute.
false
if the attribute is read-only and true
if it is
updateable.public java.lang.Object getAttribute(int ix)
RowImpl
getAttribute
in interface AttributeList
getAttribute
in class RowImpl
ix
- an integer in the range 0
to getAttributeCount() - 1
.
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface AttributeList
getAttribute
in class RowImpl
name
- the name of the attribute.
public void setAttribute(int index, java.lang.Object val)
This method performs a type-check on the value, so that it matches the Java type of the attribute.
setAttribute
in interface AttributeList
setAttribute
in class RowImpl
index
- the index of the attribute.val
- the new value.
ReadOnlyAttrException
- if the attribute is not updateable.
InvalidOperException
- if this row belongs is to a forward-only View Object.
DataCreationException
- if the given value is not convertible to the Java type of the attribute.
AttrSetValException
- if any validation logic fails while setting this attribute to the mapped Entity
Object attribute.protected void registerAttributeException(AttributeDef attrDef, java.lang.Object val, JboException dce)
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface AttributeList
setAttribute
in class RowImpl
name
- the name of the attribute.value
- the value of the attribute.protected void populateAttribute(int index, java.lang.Object value)
populateAttribute
in class RowImpl
index
- value
- protected void populateAttribute(java.lang.String name, java.lang.Object value)
public boolean isDead()
RowImpl
isDead
in interface Row
isDead
in class RowImpl
public void refresh(int refreshMode)
RowImpl
refreshMode
should be
a combination of REFRESH_...
. See REFRESH_...
constants for
further information.
refresh
in interface Row
refresh
in class RowImpl
refreshMode
- the refresh mode.public void remove()
remove
on the updateable
Entity Rows that are referenced by this View Object Row. After the referenced, updateable entity rows have been
removed this method will remove the View Object Row from the View Object's RowSet.
remove
in interface Row
remove
in class RowImpl
public void removeAndRetain()
RowImpl
This method differs from
in that it just removes the row from
the collection. It does not remove the underlying Entity row(s) or database row(s).
RowImpl.remove()
This method also differs from
in that after the
row is removed from the collection, it can be inserted back into the collection at another
location.
RowImpl.removeFromCollection()
removeAndRetain
in interface Row
removeAndRetain
in class RowImpl
public void removeFromCollection()
RowImpl
This method differs from
in that it just removes the row from
the collection. It does not remove the underlying Entity row(s) or database row(s). However,
once the row is removed, it cannot be used any more. If you want to remove the row from the
collection and insert it elsewhere, call RowImpl.remove()
.
RowImpl.removeAndRetain()
removeFromCollection
in interface Row
removeFromCollection
in class RowImpl
public void validate()
RowImpl
validate
in interface Row
validate
in class RowImpl
EntityImpl.validate()
,
validate()
public AttributeDef lookupAttributeDef(java.lang.String attrName)
public AttributeDef findAttributeDef(java.lang.String attrName)
public int getAttributeIndexOf(java.lang.String attrName)
getAttributeIndexOf
in interface AttributeList
getAttributeIndexOf
in class RowImpl
attrName
- the alias of the attribute.
public final ViewDefImpl getViewDef()
public void setAttributeValues(List names, List values)
Row
protected java.lang.Object getAttributeInternal(int index)
Note that this is an "inner" accessor for an attribute and does not callout to the generated
getXXX() method on a subclass of a ViewRowImpl.
getAttribute()
methods are the "outer" methods that callout to a subclass's
getXXX() method where XXX is the name of the
attribute.
getAttributeInternal
in class RowImpl
index
- the index of the attribute.
public java.lang.Object[] getAttributeValues()
RowImpl
getAttributeValues
in interface AttributeList
getAttributeValues
in class RowImpl
public final ViewObject getViewObject()
public EntityImpl[] getEntities()
This method makes a copy of the internal list of Entity rows and returns that copy to the caller.
public java.lang.String[] getAttributeNames()
RowImpl
getAttributeNames
in interface AttributeList
getAttributeNames
in class RowImpl
protected EntityImpl[] createMissingEntitiesFromViewDef(ViewDefImpl viewDef, int[] eoIndices, EntityImpl[] entities, ResultSet resultSet, AttributeList initValues, boolean isNewRow, ApplicationModule viewAccessorAM)
public final EntityImpl getEntity(int index)
index
- the index of the Entity.public void revert()
public java.lang.Object getHandle()
Each row in a collection can be identified by either its Java object reference or by its row handle. The row handle, together with the collection name, forms an identifier that can be stored externally, in order to identify the row in future operations.
Applications should not rely on indentifier having a specific format: it is subject to change.
A row handle can be converted to a string using toString()
methods, and compared using equals
public boolean isTransientTransactionListener()
public int getEntityCount()
protected void populateAttributeAsChanged(int index, java.lang.Object value)
Populate this attribute with the given attribute and mark the attribute as changed. This is a Framework-internal method that loads attribute values into entities that comprise this ViewRow.
protected void initDefaults()
protected void checkForOuterJoins()
protected void create(AttributeList nvp)
This method invokes create(AttributeList)
on each of the "new" entities
that make up this View Row.
The attribute list nvp is simply passed to the new entity rows that make up this View Row.
Note: the names in the attribute list are not transformed into entity-relative names hoping that the caller has done so already. If not, the entity's create() method might fail.
nvp
- the list of attributtes.protected void setEffectiveDateOnEntities()
protected void copyFrom(ViewRowImpl other)
other
- public boolean throwOnListBindingMismatch()
protected void populate(ResultSet resultSet)
Populate this row from the ResultSet.
This is a Framework-internal method. This method is used to fill in entity-attributes from a JDBC ResultSet that is returned by executeQuery().
Note that the method works on the current row of the result set and any currecy change on the ResultSet could throw it off. This method is protected to let sub-ViewRows fill in custom-entities created based on data.
For example, if fax is a subtype of doc and based on a column value, either doc is created or a fax is created for a given entity type, this method may be used to create entities based on the data values. Note that the developer needs to know exact position of values in the JDBC ResultSet.
resultSet
- the JDBC ResultSet containing the row data.public void entityCacheAdd()
protected void setEntities(EntityImpl[] rows)
This method is called by framework, after entites are created for this row. This must be protected because subclasses can create their own entity instances and have the viewrow manage them.
For example, assume there is a ViewRow on the Doc Entity where Doc has subclasses PO and Req, the ViewRow subclass can create PO/Req instances of entities based on some logic and have ViewRow manage them as an entity of type Doc.
protected java.lang.Object getAttrInvokeAccessor(int ix, AttributeDefImpl attrRef) throws java.lang.Exception
java.lang.Exception
protected RowSet createViewAccessorRS(java.lang.String vaName)
protected RowSet createViewAccessorRS(ViewAccessorDef va)
protected boolean shouldAddViewAccessorRSToRow()
public final RowSet getRowSet()
public ViewAccessorDef findViewAccessorDef(java.lang.String name)
ViewAccessorDef
with the specified name.
findViewAccessorDef
in class RowImpl
name
- The name of the ViewAccessorDef
.
ViewAccessorDef
protected List getListBindings()
getListBindings
in class RowImpl
protected ListBinding createListBinding(ListBindingDef lbDef, RowSetIterator rsi)
lbDef
- The definition objectrsi
- The Rowset that is created from the Accessor Definiton specified in List binding definition
protected java.lang.String findListBindingName(java.lang.String attrName, java.lang.String lbName)
protected RowSetIterator findListBindingRSI(java.lang.String attrName, java.lang.String lbName)
protected EntityImpl getEntityForListBinding(java.lang.String eoName)
eoName
- name of the entity to be returned
protected RowSetIterator getListBindingRSI(ListBindingDef def)
getListBindingRSI
in class RowImpl
protected ApplicationModule getApplicationModuleForViewAccessor()
public final ApplicationModule getApplicationModule()
protected ViewObject findOrCreateLocalViewObject(ViewAccessorDef vaDef)
vaDef
- The ViewAccessorDef
.
protected void clearAttributeException(int index)
clearAttributeException
in class RowImpl
protected void setAttrInvokeAccessor(int index, java.lang.Object val, AttributeDefImpl attrRef) throws java.lang.Exception
java.lang.Exception
protected void setAttributeInternal(int index, java.lang.Object val)
This method also does not perform any type-check for the value's java type and assumes that the value-type is same as the java-type for this attribute.
index
- The index of the attribute.val
- The value.
ReadOnlyAttrException
- if the attribute is not updateable.
AttrSetValException
- if any validation logic fails while setting this attribute to the mapped Entity attribute.protected boolean isViewAccessorAttribute(int indexAttribute)
indexAttribute
- The index of the attribute.
public void setTransientAttributeValue(ViewAttributeDefImpl vad, java.lang.Object val)
protected void handleListBindingMismatch(ListBinding lb, Map valuesMap, RowIterator listRSI)
handleListBindingMismatch
in class RowImpl
protected final boolean hasListBindings()
hasListBindings
in class RowImpl
public void setNewRowState(byte state)
Row
This method should be used to create a row and then to mark it temporary (STATUS_INITIALIZED) so that an app can use the created Row to fill UIs like Table UIs with valid default values for rows. Then when the Row values are updated, UIs should once again call this method to turn the Row into new (STATUS_NEW) state before any setAttribute calls on the Row, so that the changes are validated and posted.
When a created row is in STATUS_NEW (by default) state and this method is called to turn the row in to STATUS_INITIALIZED, all updateable entities that this row comprises of, de=registers themselves from their respective transaction and validation managers. Assocation and ViewLink finders will not find/include these rows. Only the collection into which this row was inserted into will contain a reference to this row and when that collection is re-executed this row cannot be reached via the framework. To include this row again an app should call this method again with STATUS_NEW as the method-argument
When this row is in STATUS_INITIALIZED state and this method is called with STATUS_NEW state then, this new row is added back into it's relevant transaction and validation manager and will then participate in validation, transaction cycles.
Note that incase of composition if a master/detail hierarchy is being created with the intention of making them temporary (STATUS_INITIALIZED) then the logic should be: Create Master row, insert Master row into a collection, create Detail row insert detail row into a relevant collection, make detail row initialized, create/insert/change-to-initialized more detail rows and at the end set the master row as initialized.
state
- This could be STATUS_NEW or STATUS_INITIALIZED.protected RowSet findOrCreateViewAccessorRS(ViewAccessorDef va)
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |