1 56 package org.objectstyle.cayenne.dba.sqlserver; 57 58 import org.objectstyle.cayenne.access.jdbc.BatchAction; 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 66 70 public class SQLServerActionBuilder extends JdbcActionBuilder { 71 72 public SQLServerActionBuilder(DbAdapter adapter, EntityResolver resolver) { 73 super(adapter, resolver); 74 } 75 76 public SQLAction batchAction(BatchQuery query) { 77 79 boolean useOptimisticLock = query.isUsingOptimisticLocking(); 81 82 boolean runningAsBatch = !useOptimisticLock && adapter.supportsBatchUpdates(); 83 BatchAction action = new SQLServerBatchAction(query, adapter, entityResolver); 84 action.setBatch(runningAsBatch); 85 return action; 86 } 87 88 public SQLAction procedureAction(ProcedureQuery query) { 89 return new SQLServerProcedureAction(query, getAdapter(), getEntityResolver()); 90 } 91 } 92 | Popular Tags |