18 package com.mysql.clusterj.openjpa;
20 import com.mysql.clusterj.core.util.I18NHelper;
21 import com.mysql.clusterj.core.util.Logger;
22 import com.mysql.clusterj.core.util.LoggerFactoryService;
23 import org.apache.openjpa.jdbc.kernel.JDBCStoreQuery;
24 import org.apache.openjpa.jdbc.meta.ClassMapping;
25 import org.apache.openjpa.kernel.exps.ExpressionFactory;
26 import org.apache.openjpa.kernel.exps.ExpressionParser;
27 import org.apache.openjpa.kernel.exps.QueryExpressions;
28 import org.apache.openjpa.meta.ClassMetaData;
33 @SuppressWarnings(
"serial")
43 ExpressionParser expressionParser) {
44 super(storeManager, expressionParser);
48 protected Number executeDelete(Executor ex, ClassMetaData base,
49 ClassMetaData[] metas,
boolean subclasses, ExpressionFactory[] facts,
50 QueryExpressions[] exps, Object[] params) {
51 if (logger.isDebugEnabled()) {
52 logger.debug(
"NdbOpenJPAStoreQuery.executeDelete(Executor ex, ClassMetaData base, " +
53 "ClassMetaData[] metas, boolean subclasses, ExpressionFactory[] facts, " +
54 "QueryExpressions[] exps, Object[] params).\n" +
55 "Class: " + base.getTypeAlias() +
56 " query expressions: " + exps +
"[" + exps.length +
"]" +
57 " exps[0].filter: " + exps[0].filter);
60 NdbOpenJPADomainTypeHandlerImpl<?> domainTypeHandler = store.getDomainTypeHandler((ClassMapping)base);
61 if (domainTypeHandler.isSupportedType()
63 && exps[0].filter.getClass().getName().contains(
"EmptyExpression")) {
65 if (logger.isDebugEnabled()) {
66 logger.debug(
"Empty Expression for delete will delete the entire extent.");
68 int count = store.deleteAll(domainTypeHandler);
71 if (logger.isDebugEnabled()) logger.debug(
"NdbOpenJPAStoreQuery.executeDelete delegated to super.");
72 return super.executeDelete(ex, base, metas, subclasses, facts, exps, params);