public class ProgrammaticEntityImpl extends EntityImpl
| Modifier and Type | Class and Description | 
|---|---|
static class  | 
ProgrammaticEntityImpl.CommitActionType  | 
CURRENT_VERSION, DML_DELETE, DML_INSERT, DML_UPDATE, MAXATTRCONST, mOrigData, ORACLE_ROWID_COLUMN, ORIGINAL_VERSION, PROPERTY_FORCE_BATCH_ON_CHILDREN, PROPERTY_LOOKUP_ACCESSOR, PROPERTY_LOOKUP_ATTR_NAME, PROPERTY_LOOKUP_DISPATTR, PROPERTY_LOOKUP_TYPE, PROPERTY_MULTIPLE_VERSION_NUMBER_UPDATE, SKIP_ON_ATTR_ERR, SYS_EFFDT_ROW_SPLIT, TRANS_ORIGINAL_VERSION, XML_CI_CHANGED, XML_PK_CHANGED, XML_PK_CHANGED_YESPROPERTY_SERVICE_RESOURCE_CONTAINER_PATHSTATUS_DEAD, STATUS_DELETED, STATUS_MODIFIED, STATUS_UNMODIFIEDEFFDT_ADJUST_EFFECTIVE_END_DATE_MODE, EFFDT_ADJUST_EFFECTIVE_START_DATE_MODE, EFFDT_DELETE_FUTURE_CHANGE_MODE, EFFDT_DELETE_MODE, EFFDT_DELETE_NEXT_CHANGE_MODE, EFFDT_DELETE_THIS_CHANGE_MODE, EFFDT_DELETE_ZAP_MODE, EFFDT_EXPERT_MODE, EFFDT_NONE_MODE, EFFDT_UPDATE_CHANGE_INSERT_MODE, EFFDT_UPDATE_CORRECTION, EFFDT_UPDATE_INSERT_MODE, EFFDT_UPDATE_MODE, EFFDT_UPDATE_NEW_EARLIEST_CHANGE_MODE, EFFDT_UPDATE_OVERRIDE_MODE, REFRESH_CONTAINEES, REFRESH_FORGET_NEW_ROWS, REFRESH_REMOVE_NEW_ROWS, REFRESH_UNDO_CHANGES, REFRESH_WITH_DB_FORGET_CHANGES, REFRESH_WITH_DB_ONLY_IF_UNCHANGED, STATUS_INITIALIZED, STATUS_NEWXML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT, XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE, XML_PASSIVATION_USERESERVED_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_DEFRESERVED_VAR_VALUE| Constructor and Description | 
|---|
ProgrammaticEntityImpl()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
afterRollback(TransactionEvent e)
Internal: Applications should not call this method. 
 | 
void | 
beforeCommit(TransactionEvent e)
Polls transaction listeners before a commit operation. 
 | 
protected void | 
commitDataProvider(ProgrammaticEntityImpl.CommitActionType commitActionType)
Override this method to perform commit on custom datasource, if the custom Datasource is supporting 
 both postChange / commit separately 
 | 
protected ViewObjectImpl | 
createAssociationAccessorVO(AssociationDefImpl assocDef,
                           java.lang.String voName,
                           EntityAssociation eoAssoc)  | 
protected void | 
doDML(int operation,
     TransactionEvent e)
Performs INSERT/UPDATE/DELETE processing for the row. 
 | 
protected void | 
doSelect(boolean lock)
Advanced: Most applications should not use this method. 
 | 
protected java.util.HashMap<java.lang.String,java.lang.Object> | 
getChangedAttributeMap()  | 
protected java.util.HashMap<java.lang.String,java.lang.Object> | 
getPrimaryKeyMap(boolean orig)  | 
protected java.util.List<SparseArray> | 
getRowFromDataSource(java.util.HashMap<java.lang.String,java.lang.Object> origPrimaryKeyMap)
User should override this method and return the List of rows from Datasource which matches 
 this Entity's primary key. 
 | 
protected void | 
lockDataProvider(boolean lock)
Override this API to lock the underneath dataprovider. 
 | 
protected java.util.HashMap<java.lang.String,java.lang.Object> | 
postDataProvider(int operationType,
                java.util.ArrayList retAttrNames)
Override this method to insert/delete/update a Row into custom datasource 
 | 
protected void | 
rollbackDataProvider()
Override this method to perform rollback on custom datasource, if the custom Datasource is supporting 
 both postChange / commit separately 
 | 
protected void | 
setLocked(boolean lockedState)
Sets the locked state. 
 | 
addToTransactionManager, addToValidationListeners, addTransactionPostListener, addTransactionPostListenerNoCheck, afterCommit, afterRemove, appendXMLElementNodes, appendXMLElementNodesForAttrs, beforeRollback, bindDMLStatement, bindWhereClause, buildDMLStatement, buildRefreshSQL, buildWhereClause, callPostChanges, checkConsistency, clearAttributeException, compare, copyChangedNonKeyAttributes, copyEffDtEntity, create, createArray, createAssociationAccessorRS, createBlob, createClob, createEntityAttrHints, createEntityViewLinkAccessorRS, createEntityViewLinkAccessorVO, createNClob, createRef, createStruct, createUnqualifiedRowSet, createViewAccessorRS, createViewAccessorRS, doAllowsOperation, doDMLForCascadeUpdate, doDMLWithLOBs, doEffectiveDateRangeOperation, domainToBeModified, donePostingAll, doRefreshSQL, doSelectForAltKey, eventsDebugOnly, fetchExprValueSupplierOverrideRow, findAssociationAccessorVO, findEntityViewLinkAccessorVO, findOrCreateAssociationAccessorRS, findOrCreateLocalViewObject, findOrCreateViewAccessorRS, findOrCreateViewAccessorRS, findViewAccessorDef, findViewAccessorVO, getAltKey, getAttribute, getAttribute, getAttribute, getAttributeChangedCount, getAttributeCount, getAttributeHints, getAttributeHints, getAttributeIndexOf, getAttributeInternal, getAttributeNames, getAttributeValue, getAttributeValues, getAttrInvokeAccessor, getBaseAttributeCount, getChangeIndicator, getComparator, getContainerEntity, getCustomizedStructureDef, getDBTransaction, getDynamicAttributeCount, getDynamicAttributeValue, getEffDtInitEndDateValue, getEffectiveDate, getEntityCache, getEntityCacheInternal, getEntityDef, getEntityState, getExprVarVal, getHistoryContextForAttribute, getKey, getKeyForLogger, getListBindingRSI, getListBindings, getLookupDescription, getOrigData, getOriginalAttributeValue, getParentVariableManager, getPKBasedRef, getPostedAttribute, getPostState, getPrimaryKey, getPrimaryPostState, getPrimaryRowState, getRefreshSQLKeyAttrs, getScriptRowOperations, getSelectedListDisplayValue, getSelectedListDisplayValues, getSQLBuilder, getStateAsString, getStringForLogger, getStructureDef, getTransactionListeners, getTransactionListenersList, getTransPostHandle, getValidationListeners, getValidationListenersList, handleActivatedRowNotFound, handleEffectiveDateOperations, handleEffectiveDateRowCreate, handleEffectiveDateRowDelete, handleEffectiveDateRowUpdate, handleListBindingMismatch, handlePostChangesError, hasAttributeException, hasExprVarVal, hasListBindings, hasUpdatePrivilege, initAttributeValuesFromNameValuePairDuringCreate, initBusLogicGroupDefaults, initBusLogicGroupDfltExprAttrs, initData, initDefaultExpressionAttributes, initDefaults, initialize, isAttributeChanged, isAttributeChanged, isAttributeChangedInTransaction, isAttributePopulated, isAttributePopulated, isAttributeUpdateable, isDead, isInCache, isInvalid, isLocked, isLookupIdValid, isOrigDataEmpty, isOrigDataPopulated, isPostedToDB, isSkipDML, isTransientTransactionListener, isTransientTransactionPostListener, isValid, isViewAccessorAttribute, lock, lockTopLevelEntity, markViewAccessorsDirty, notifyAttributesAndBlgChanged, notifyAttributesChanged, notifyAttributesChanged, notifyEntityActivated, notifyEventRaised, outputEventString, populateAttribute, populateAttribute, populateAttribute, populateAttributeAsChanged, postChanges, prepareForBatchDML, prepareForDML, prepareVOToFetchNextEffDtRows, prepareVOToFetchNextEffDtRows, prepareVOToFetchNextEffDtSeqRows, prepareVOToFetchNextEffDtSeqRows, prepareVOToFetchPrevEffDtRows, prepareVOToFetchPrevEffDtRows, prepareVOToFetchPrevEffDtSeqRows, prepareVOToFetchPrevEffDtSeqRows, readAttrsFromXML, readXML, refresh, refreshFKInNewContainees, registerAttributeException, remove, removeAndRetain, removedByAnotherTrans, removeFromCollection, removeTransactionPostListener, resetPKBasedRef, revert, revertChangesToEffDtEntity, setAttribute, setAttribute, setAttributeChanged, setAttributeInternal, setAttributeValues, setAttrInvokeAccessor, setDynamicAttributeValue, setEffectiveDateMode, setEntityDef, setInvalid, setNewRowState, setPostedToDB, setTransPostHandle, toString, validate, validateDateEffectivity, validateEntity, variablesAdded, vetoRemoveWithDetailsaddListBindingsForAttribute, clearAllExceptions, clearAttributeException, clearRowExceptions, createXMLDefinition, doAutoClearAttribute, ensureVariableManager, findAttrAndGetIndex, findListBindingName, forceFilterListExecute, getAllExceptions, getAttributeInternal, getAttributeSecurityHints, getAttributeSecurityHints, getCombinedAttrNames, getEffectiveDateMode, getExprMethodVal, getExprVarValType, getGlobalOperations, getHints, getMessageBundleClass, getMethodKind, getResourceBundleDef, getRowExceptions, getRowForBindVarExprEvalInternal, getSecurityHints, getVariableManager, getViewAccessorResultIndex, hasAttributeException, hasDeferredExceptions, hasVariables, invokeMethod, isRefreshRequired, isRefreshRequired, isRefreshRequired, lookupListBinding, printXMLDefinition, readXML, refreshViewAccessor, refreshViewAccessor, refreshViewAccessor, registerRowException, setAttributeInternal, setExprVarVal, setInMultiSetter, skipFilterListOnKeyAttributes, writeXML, writeXML, writeXML, writeXMLclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAttributeSecurityHints, getAttributeSecurityHints, getEffectiveDateMode, getSecurityHintsprotected java.util.HashMap<java.lang.String,java.lang.Object> postDataProvider(int operationType,
                                                                                java.util.ArrayList retAttrNames)
operationType - - possible values for this flag are EntityImpl.DML_INSERT , EntityImpl.DML_UPDATE and
 EntityImpl.DML_DELETE. Based on the opeartion type, we should update the datasource with latest values.retAttrNames - - List of attribute names, whose values need to be returned once insert/update been performed.protected void rollbackDataProvider()
protected void commitDataProvider(ProgrammaticEntityImpl.CommitActionType commitActionType)
commitActionType - - possible values for this flag are:-
 CommitActionType.DELETE - Delete the row from cache and original custom DS
 CommitActionType.MERGE  - Merge the row from cache to original custom DS
 CommitActionType.IGNORE - Ignore this cached row and perform No action for Original rowprotected java.util.List<SparseArray> getRowFromDataSource(java.util.HashMap<java.lang.String,java.lang.Object> origPrimaryKeyMap)
origPrimaryKeyMap - - Attribute Name-Value Map of original key values. It may possible that user modify the
 PK attributeprotected void lockDataProvider(boolean lock)
lock - - If true, lock the underneath data providerprotected void doDML(int operation,
                     TransactionEvent e)
EntityImplThis method calls buildDMLStatement() to build the DML string based on the DML operation to be performed. For insert and update, the DML statement will only set the values that have been modified/changed. Other attributes do not participate in the DML.
Next, bindDMLStatement() is called to bind the DML statement with values to be updated and any other where-clause and returning parameters. After this, it executes the jdbc-statement or adds the current DML as a batch operation into a batched jdbc-statement, to be executed in Transaction.postChanges().
Here is sample code for overriding the doDML() method of any Entity Object's EntityImpl class to invoke a stored procedure, and pass arguments. For example, given a PL/SQL stored procedure like:
 PROCEDURE updateDepartment( p_Deptno NUMBER,
                             p_Dname  VARCHAR2,
                             p_Loc    VARCHAR2 )
 
 The code to call it when an Entity is updated would look like this: Note: The following code assumes only updates are possible, disallowing inserts and deletes by ignoring them in the doDML() method.
    public void doDML(int operation, TransactionEvent e) {
       // Don't call the superclass. This procedure handles only updates
       //super.doDML(operation, e);
       CallableStatement stmt = null;
       // ONLY Perform updates, this Entity won't allow inserts/deletes.
       if (operation == DML_UPDATE)
       {
         // Prepare JDBC CallableStatement with the Stored Procedure Call
         String updateStr = "{call updateDepartment(?,?,?)}";
         stmt = getDBTransaction().createCallableStatement(updateStr, 1);
         try
         {
            // Bind the Statement Parameters and Execute this Statement
            stmt.setString(1, getDeptno().toString());
            stmt.setString(2, getDname().toString());
            stmt.setString(3, getLoc().toString());
            stmt.execute();
          }
          catch (Exception ex)
          {
            throw new oracle.jbo.JboException(ex);
          }
          finally
          {
             try
             {
                stmt.close();
             }
             catch (Exception nex)
             {
          }
        }
      }
    }
 
 doDML in class EntityImploperation - the integer representation of DML_INSERT, DML_UPDATE, or
 DML_DELETE.e - this Entity Object's transaction event.protected java.util.HashMap<java.lang.String,java.lang.Object> getChangedAttributeMap()
protected void doSelect(boolean lock)
EntityImplPerforms SELECT/SELECT FOR UPDATE processing for the row. This method faults-in all column-values from the database object for this Entity Object.
This method can be overridden, for example, if you want to fill in the Entity Object values yourself.
doSelect in class EntityImpllock - true generates a "SELECT for UPDATE"protected final void setLocked(boolean lockedState)
EntityImpl
 This method is protected since users should call lock
 to place the row into the correct locked state.
setLocked in class EntityImpllockedState - set to true to lock the row.protected ViewObjectImpl createAssociationAccessorVO(AssociationDefImpl assocDef, java.lang.String voName, EntityAssociation eoAssoc)
createAssociationAccessorVO in class EntityImplpublic final void afterRollback(TransactionEvent e)
EntityImplInitiates a state change and polls listeners following a rollback operation.
Resets the EntityState to STATUS_DEAD or STATUS_UNMODIFIED for new or updated/removed rows respectively. Sets other status flags for this Entity Object so that it behaves just like it was fetched for the first time from the database.
This method should not be overridden.
afterRollback in interface TransactionListenerafterRollback in class EntityImple - this Entity Object's transaction event.TransactionListenerpublic final void beforeCommit(TransactionEvent e)
EntityImplbeforeCommit in interface TransactionListenerbeforeCommit in class EntityImple - this Entity Object's transaction event.TransactionListenerprotected final java.util.HashMap<java.lang.String,java.lang.Object> getPrimaryKeyMap(boolean orig)
orig - - If passed as true, this API return the original PK value map else the current PK values
 map