1 21 package oracle.toplink.essentials.queryframework; 23 24 import oracle.toplink.essentials.exceptions.*; 25 import oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl; 26 27 39 public class DataModifyQuery extends ModifyQuery { 40 public DataModifyQuery() { 41 super(); 42 } 43 44 public DataModifyQuery(String sqlString) { 45 this(); 46 47 setSQLString(sqlString); 48 } 49 50 public DataModifyQuery(Call call) { 51 this(); 52 setCall(call); 53 } 54 55 60 public Object executeDatabaseQuery() throws DatabaseException { 61 62 63 if (getSession().isUnitOfWork()) { 64 UnitOfWorkImpl unitOfWork = (UnitOfWorkImpl)getSession(); 65 66 if ( !unitOfWork.getCommitManager().isActive() && !unitOfWork.isInTransaction()) { 67 unitOfWork.beginEarlyTransaction(); 68 } 69 unitOfWork.setWasNonObjectLevelModifyQueryExecuted(true); 70 } 71 return getQueryMechanism().executeNoSelect(); 72 } 73 74 78 public boolean isDataModifyQuery() { 79 return true; 80 } 81 82 86 protected void prepare() { 87 super.prepare(); 88 89 getQueryMechanism().prepareExecuteNoSelect(); 90 } 91 92 98 public void prepareForExecution() throws QueryException { 99 super.prepareForExecution(); 100 101 setModifyRow(getTranslationRow()); 102 } 103 } 104 | Popular Tags |