Trying to use this HQL: DELETE TransactionLogTemp WHERE TransactionLogTemp.Transactionid in (%1)
replace %1 with a list of id's comma separated
Hibernate version: 3.1.3
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class name="com.travelbahn.xgwStats.hib.TransactionLogTemp" table="TransactionLog_temp" catalog="AmexPerf">
<id name="transactionid" type="integer">
<column name="TRANSACTIONID" />
<generator class="assigned" />
</id>
<property name="sessionid" type="integer">
<column name="SESSIONID" />
</property>
<property name="clientid" type="string">
<column name="CLIENTID" length="100" />
</property>
<property name="parentTrxid" type="integer">
<column name="PARENT_TRXID" />
</property>
<property name="trxState" type="string">
<column name="TRX_STATE" length="100" />
</property>
<property name="trxStart" type="timestamp">
<column name="TRX_START" length="19" not-null="true" />
</property>
<property name="totalTrxTime" type="integer">
<column name="TOTAL_TRX_TIME" />
</property>
<property name="trxName" type="string">
<column name="TRX_NAME" length="100" />
</property>
<property name="userid" type="integer">
<column name="USERID" />
</property>
<property name="clientIp" type="string">
<column name="CLIENT_IP" length="20" />
</property>
<property name="servicingHost" type="string">
<column name="SERVICING_HOST" length="100" />
</property>
<property name="travelerid" type="integer">
<column name="TRAVELERID" />
</property>
<property name="loggingApp" type="string">
<column name="LoggingApp" length="100" />
</property>
<property name="metricName1" type="string">
<column name="METRIC_NAME1" length="100" />
</property>
<property name="metricValue1" type="string">
<column name="METRIC_VALUE1" length="100" />
</property>
<property name="metricName2" type="string">
<column name="METRIC_NAME2" length="100" />
</property>
<property name="metricValue2" type="string">
<column name="METRIC_VALUE2" length="100" />
</property>
<property name="metricName3" type="string">
<column name="METRIC_NAME3" length="100" />
</property>
<property name="metricValue3" type="string">
<column name="METRIC_VALUE3" length="100" />
</property>
<property name="metricName4" type="string">
<column name="METRIC_NAME4" length="100" />
</property>
<property name="metricValue4" type="string">
<column name="METRIC_VALUE4" length="100" />
</property>
<property name="metricName5" type="string">
<column name="METRIC_NAME5" length="100" />
</property>
<property name="metricValue5" type="string">
<column name="METRIC_VALUE5" length="100" />
</property>
<property name="metricName6" type="string">
<column name="METRIC_NAME6" length="100" />
</property>
<property name="metricValue6" type="string">
<column name="METRIC_VALUE6" length="100" />
</property>
<property name="metricName7" type="string">
<column name="METRIC_NAME7" length="100" />
</property>
<property name="metricValue7" type="string">
<column name="METRIC_VALUE7" length="100" />
</property>
<property name="metricName8" type="string">
<column name="METRIC_NAME8" length="100" />
</property>
<property name="metricValue8" type="string">
<column name="METRIC_VALUE8" length="100" />
</property>
<property name="metricName9" type="string">
<column name="METRIC_NAME9" length="100" />
</property>
<property name="metricValue9" type="string">
<column name="METRIC_VALUE9" length="100" />
</property>
<property name="metricName10" type="string">
<column name="METRIC_NAME10" length="100" />
</property>
<property name="metricValue10" type="string">
<column name="METRIC_VALUE10" length="100" />
</property>
<property name="metricName11" type="string">
<column name="METRIC_NAME11" length="100" />
</property>
<property name="metricValue11" type="string">
<column name="METRIC_VALUE11" length="100" />
</property>
<property name="metricName12" type="string">
<column name="METRIC_NAME12" length="100" />
</property>
<property name="metricValue12" type="string">
<column name="METRIC_VALUE12" length="100" />
</property>
<property name="metricName13" type="string">
<column name="METRIC_NAME13" length="100" />
</property>
<property name="metricValue13" type="string">
<column name="METRIC_VALUE13" length="100" />
</property>
<property name="metricName14" type="string">
<column name="METRIC_NAME14" length="100" />
</property>
<property name="metricValue14" type="string">
<column name="METRIC_VALUE14" length="100" />
</property>
<property name="metricName15" type="string">
<column name="METRIC_NAME15" length="100" />
</property>
<property name="metricValue15" type="string">
<column name="METRIC_VALUE15" length="100" />
</property>
<property name="metricName16" type="string">
<column name="Metric_Name16" length="100" />
</property>
<property name="metricValue16" type="string">
<column name="Metric_Value16" length="100" />
</property>
<property name="metricName17" type="string">
<column name="Metric_Name17" length="100" />
</property>
<property name="metricValue17" type="string">
<column name="Metric_Value17" length="100" />
</property>
<property name="metricName18" type="string">
<column name="Metric_Name18" length="100" />
</property>
<property name="metricValue18" type="string">
<column name="Metric_Value18" length="100" />
</property>
<property name="metricName19" type="string">
<column name="Metric_Name19" length="100" />
</property>
<property name="metricValue19" type="string">
<column name="Metric_Value19" length="100" />
</property>
<property name="metricName20" type="string">
<column name="Metric_Name20" length="100" />
</property>
<property name="metricValue20" type="string">
<column name="Metric_Value20" length="100" />
</property>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
StatelessSession session = sessionFactory.openStatelessSession();
Transaction tx = session.beginTransaction();
Query q = session.createQuery(stmt);
int ret = q.executeUpdate();
tx.commit();
session.close();
Full stack trace of any exception that occurs:Code:
Exception in thread "main" java.lang.NullPointerException
at org.hibernate.hql.ast.tree.IdentNode.resolveAsNakedComponentPropertyRefLHS(IdentNode.java:195)
at org.hibernate.hql.ast.tree.IdentNode.resolve(IdentNode.java:85)
at org.hibernate.hql.ast.tree.DotNode.resolveFirstChild(DotNode.java:139)
at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(HqlSqlWalker.java:462)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.addrExpr(HqlSqlBaseWalker.java:4316)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1211)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4032)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3832)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1758)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.deleteStatement(HqlSqlBaseWalker.java:425)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:245)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at com.travelbahn.xgwStats.hib.HibBaseProcess.doUpdate(HibBaseProcess.java:32)
at com.travelbahn.xgwStats.AnalyzePerfHib.deleteDupes(AnalyzePerfHib.java:197)
at com.travelbahn.xgwStats.AnalyzePerfHib.clearDupes(AnalyzePerfHib.java:175)
at com.travelbahn.xgwStats.AnalyzePerfHib.process(AnalyzePerfHib.java:93)
at com.travelbahn.xgwStats.XGWStatsProcess.process(XGWStatsProcess.java:51)
at com.travelbahn.xgwStats.XGWStatsProcess.main(XGWStatsProcess.java:179)
Name and version of the database you are using:
MySQL 5