-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: new() not working correctly
PostPosted: Tue Dec 21, 2004 6:19 am 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.