|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.7.0) E10653-08 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jbo.server.RowImpl
oracle.jbo.server.EntityImpl
oracle.jbo.server.DSEntityImpl
public class DSEntityImpl
Field Summary |
---|
Fields inherited from class oracle.jbo.server.EntityImpl |
---|
CURRENT_VERSION, DML_DELETE, DML_INSERT, DML_UPDATE, MAXATTRCONST, mOrigData, ORACLE_ROWID_COLUMN, ORIGINAL_VERSION, PROPERTY_LOOKUP_ACCESSOR, PROPERTY_LOOKUP_ATTR_NAME, PROPERTY_LOOKUP_DISPATTR, PROPERTY_LOOKUP_TYPE, SYS_EFFDT_ROW_SPLIT, XML_CI_CHANGED, XML_PK_CHANGED, XML_PK_CHANGED_YES |
Fields inherited from interface oracle.jbo.server.Entity |
---|
STATUS_DEAD, STATUS_DELETED, STATUS_MODIFIED, STATUS_UNMODIFIED |
Fields inherited from interface oracle.jbo.XMLInterface |
---|
XML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT, XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE, XML_PASSIVATION_USE |
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 | |
---|---|
DSEntityImpl()
default constructor |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.jbo.Row |
---|
getAttributeSecurityHints, getAttributeSecurityHints, getEffectiveDateMode, getSecurityHints |
Methods inherited from interface oracle.jbo.XMLInterface |
---|
readXML, writeXML, writeXML, writeXML, writeXML |
Constructor Detail |
---|
public DSEntityImpl()
Method Detail |
---|
protected void doDML(int operation, TransactionEvent e)
EntityImpl
This 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 EntityImpl
operation
- the integer representation of DML_INSERT, DML_UPDATE, or
DML_DELETE.e
- this Entity Object's transaction event.protected void doSelect(boolean lock)
EntityImpl
Performs 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 EntityImpl
lock
- true generates a "SELECT for UPDATE"
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.7.0) E10653-08 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |