Hibernate version:
2.1.7
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Caused by: net.sf.hibernate.PropertyNotFoundException: no appropriate constructor in class: com.azure.calculus.taskcontroller.tasks.rerate.RerateTask$RerateResultRow
at net.sf.hibernate.util.ReflectHelper.getConstructor(ReflectHelper.java:214)
at net.sf.hibernate.hql.QueryTranslator.renderSQL(QueryTranslator.java:560)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:155)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:295)
at net.sf.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1646)
at net.sf.hibernate.impl.QueryImpl.scroll(QueryImpl.java:33)
Name and version of the database you are using:
SQLServer 2000
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
DEBUG [net.sf.hibernate.impl.SessionImpl] [pool-1-thread-1] (SessionImpl.java:558) - opened session
DEBUG [net.sf.hibernate.transaction.JDBCTransaction] [pool-1-thread-1] (JDBCTransaction.java:37) - begin
DEBUG [net.sf.hibernate.transaction.JDBCTransaction] [pool-1-thread-1] (JDBCTransaction.java:41) - current autocommit status:false
DEBUG [net.sf.hibernate.impl.SessionImpl] [pool-1-thread-1] (SessionImpl.java:1640) - scroll: select new MyCustomClass( rev.EvtId, rev.EvtDttm, rev.EvtCount, rev.EvtUsage, rev.StmId, rev.TskId, rev.SflId, rev.VersionId, rev.RevId, rev.RevCode, rev.RevCount, rev.RevUsage, rev.BipId, rev.BpdId, rev.SvcId, rev.TffId, rev.TabId, rev.BndId, rev.TrnId, rev.RevFromEltId, rev.RevToEltId, rev.RevTrnCount, rev.RevAmt, rev.CurId, rev.RevBilledUsage, rev.RevRevenueFl, rev.RevRateModifier, rce.VersionId, rce.RceId, rce.RceUniqueKey, rce.RceOriginalANo, rce.RceOriginalBNo, rce.RceOriginalCNo, rce.RceANo, rce.RceBNo, rce.RceCNo, rce.RceInRutId, rce.RceOutRutId, rce.BscId, rce.RceGroupKey, rce.RceExtra1, rce.RceExtra2, rce.RceExtra3, rce.RceExtra4, rce.RceExtra5, rce.RceExtra6, rce.RceExtra7, rce.RceExtra8, rce.RceExtra9, rce.RceExtra10 ) from RatedEvent as rev, RatedCdrEvent as rce where rev.EvtId = rce.EvtId and rev.EvtDttm >= :evtFromDttm and rev.EvtDttm <= :evtToDttm and rev.BpdId = :bpdId and rev.RevCode = :revCode and rev.StmId = :stmId
DEBUG [net.sf.hibernate.engine.QueryParameters] [pool-1-thread-1] (QueryParameters.java:112) - named parameters: {bpdId=3043, stmId=2, revCode=RD, evtToDttm=2004-08-01T23:59:59.000+01:00, evtFromDttm=2004-08-01T00:00:00.000+01:00}
DEBUG [net.sf.hibernate.hql.QueryTranslator] [pool-1-thread-1] (QueryTranslator.java:147) - compiling query
DEBUG [net.sf.hibernate.transaction.JDBCTransaction] [pool-1-thread-1] (JDBCTransaction.java:82) - rollback
DEBUG [net.sf.hibernate.impl.SessionImpl] [pool-1-thread-1] (SessionImpl.java:594) - transaction completion
DEBUG [net.sf.hibernate.impl.SessionImpl] [pool-1-thread-1] (SessionImpl.java:576) - closing session
DEBUG [net.sf.hibernate.impl.SessionImpl] [pool-1-thread-1] (SessionImpl.java:3371) - disconnecting session
DEBUG [net.sf.hibernate.impl.SessionImpl] [pool-1-thread-1] (SessionImpl.java:594) - transaction completion
I am running this HQL query
Code:
select
new MyCustomClass
(
rev.EvtId, rev.EvtDttm, rev.EvtCount, rev.EvtUsage, rev.StmId, rev.TskId, rev.SflId, rev.VersionId, rev.RevId, rev.RevCode, rev.RevCount, rev.RevUsage, rev.BipId, rev.BpdId, rev.SvcId, rev.TffId, rev.TabId, rev.BndId, rev.TrnId, rev.RevFromEltId, rev.RevToEltId, rev.RevTrnCount, rev.RevAmt, rev.CurId, rev.RevBilledUsage, rev.RevRevenueFl, rev.RevRateModifier, rce.VersionId, rce.RceId, rce.RceUniqueKey, rce.RceOriginalANo, rce.RceOriginalBNo, rce.RceOriginalCNo, rce.RceANo, rce.RceBNo, rce.RceCNo, rce.RceInRutId, rce.RceOutRutId, rce.BscId, rce.RceGroupKey, rce.RceExtra1, rce.RceExtra2, rce.RceExtra3, rce.RceExtra4, rce.RceExtra5, rce.RceExtra6, rce.RceExtra7, rce.RceExtra8, rce.RceExtra9, rce.RceExtra10
)
from RatedEvent as rev, RatedCdrEvent as rce
where rev.EvtId = rce.EvtId and rev.EvtDttm >= :evtFromDttm and rev.EvtDttm <= :evtToDttm and rev.BpdId = :bpdId and rev.RevCode = :revCode and rev.StmId = :stmId
I have the correct constructor in MyCustomClass and looking at what hibernate is doing in ReflectHelper.getConstructor() it is looking for a constructor with 100 fields rather than the 50 I actually have. For some reason it is doubling up the number. Is it a mistake in my query or a bug?