FileDocCategorySizeDatePackage
DataModifyQuery.javaAPI DocGlassfish v2 API4211Tue May 22 16:54:50 BST 2007oracle.toplink.essentials.queryframework

DataModifyQuery

public class DataModifyQuery extends ModifyQuery

Purpose: Concrete class used for executing non selecting SQL strings.

Responsibilities:

  • Execute a non selecting raw SQL string.
author
Yvon Lavoie
since
TOPLink/Java 1.0

Fields Summary
Constructors Summary
public DataModifyQuery()

        super();
    
public DataModifyQuery(String sqlString)

        this();

        setSQLString(sqlString);
    
public DataModifyQuery(Call call)

        this();
        setCall(call);
    
Methods Summary
public java.lang.ObjectexecuteDatabaseQuery()
INTERNAL: Perform the work to execute the SQL call. Return the row count of the number of rows effected by the SQL call.


        /* Fix to allow executing non-selecting SQL in a UnitOfWork. - RB */
        if (getSession().isUnitOfWork()) {
            UnitOfWorkImpl unitOfWork = (UnitOfWorkImpl)getSession();
            /* bug:4211104 for DataModifyQueries executed during an event, while transaction was started by the uow*/
            if ( !unitOfWork.getCommitManager().isActive() && !unitOfWork.isInTransaction()) {
                unitOfWork.beginEarlyTransaction();
            }
            unitOfWork.setWasNonObjectLevelModifyQueryExecuted(true);
        }
        return getQueryMechanism().executeNoSelect();
    
public booleanisDataModifyQuery()
PUBLIC: Return if this is a data modify query.

        return true;
    
protected voidprepare()
INTERNAL: Prepare the receiver for execution in a session.

        super.prepare();

        getQueryMechanism().prepareExecuteNoSelect();
    
public voidprepareForExecution()
INTERNAL: Prepare the receiver for execution in a session. In particular, set the descriptor of the receiver to the Descriptor for the appropriate class for the receiver's object.

        super.prepareForExecution();

        setModifyRow(getTranslationRow());