1 56 package org.objectstyle.cayenne.dba.oracle; 57 58 import org.objectstyle.cayenne.access.util.BatchQueryUtils; 59 import org.objectstyle.cayenne.dba.DbAdapter; 60 import org.objectstyle.cayenne.dba.JdbcActionBuilder; 61 import org.objectstyle.cayenne.map.EntityResolver; 62 import org.objectstyle.cayenne.query.BatchQuery; 63 import org.objectstyle.cayenne.query.ProcedureQuery; 64 import org.objectstyle.cayenne.query.SQLAction; 65 import org.objectstyle.cayenne.query.SelectQuery; 66 67 71 public class OracleActionBuilder extends JdbcActionBuilder { 72 73 public OracleActionBuilder(DbAdapter adapter, EntityResolver resolver) { 74 super(adapter, resolver); 75 } 76 77 public SQLAction batchAction(BatchQuery query) { 78 79 if (OracleAdapter.isSupportsOracleLOB() 81 && BatchQueryUtils.updatesLOBColumns(query)) { 82 83 return new OracleLOBBatchAction(query, getAdapter()); 84 } 85 else { 86 87 boolean useOptimisticLock = query.isUsingOptimisticLocking(); 90 boolean runningAsBatch = !useOptimisticLock && adapter.supportsBatchUpdates(); 91 92 OracleBatchAction action = new OracleBatchAction( 93 query, 94 getAdapter(), 95 getEntityResolver()); 96 action.setBatch(runningAsBatch); 97 return action; 98 } 99 100 } 101 102 public SQLAction procedureAction(ProcedureQuery query) { 103 return new OracleProcedureAction(query, getAdapter(), getEntityResolver()); 104 } 105 106 public SQLAction objectSelectAction(SelectQuery query) { 107 return new OracleSelectAction(query, getAdapter(), getEntityResolver()); 108 } 109 } 110 | Popular Tags |