-->
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.  [ 2 posts ] 
Author Message
 Post subject: select new clause problem in hql
PostPosted: Mon Oct 06, 2008 3:43 am 
Newbie

Joined: Thu Sep 22, 2005 5:17 pm
Posts: 11
Hello all,
I'm trying to use new operator in select clause in hql query.

if I use

Code:
select bo
from com.bla.bla.bo.IMyBusinessObject bo
                       where 1 = 1


everythings ok, if i use
Code:
select new com.bla.bla.wrapper.MyWrapper(bo)
from com.bla.bla.bo.IMyBusinessObject bo
                       where 1 = 1


i get
Quote:
org.hibernate.MappingException: Unknown entity: com.bla.bla.wrapper.MyWrapper
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1338)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:50)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:584)
at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:576)
at com.deltax.ui.swing.jtable.JValueListTable.paint(JValueListTable.java:252)
at javax.swing.JComponent.paintChildren(JComponent.java:842)
at javax.swing.JComponent.paint(JComponent.java:1014)
at javax.swing.JViewport.paint(JViewport.java:728)
at javax.swing.JComponent.paintChildren(JComponent.java:842)
at javax.swing.JComponent.paint(JComponent.java:1014)
at javax.swing.JComponent.paintChildren(JComponent.java:842)
at javax.swing.JComponent.paint(JComponent.java:1014)
at javax.swing.JComponent.paintChildren(JComponent.java:842)
at javax.swing.JComponent.paint(JComponent.java:1014)
at javax.swing.JComponent.paintChildren(JComponent.java:842)
at javax.swing.JComponent.paint(JComponent.java:1014)
at javax.swing.JComponent.paintChildren(JComponent.java:842)
at javax.swing.JComponent.paint(JComponent.java:1014)
at javax.swing.JComponent.paintChildren(JComponent.java:842)
at javax.swing.JComponent.paint(JComponent.java:1014)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:559)
at javax.swing.JComponent.paintChildren(JComponent.java:842)
at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1021)
at javax.swing.JComponent.paint(JComponent.java:1014)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916)
at javax.swing.JComponent._paintImmediately(JComponent.java:4859)
at javax.swing.JComponent.paintImmediately(JComponent.java:4666)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)


IMyBusinessObject is an interface used as proxy in hibernate mapping, the business object is mapped correctly, select the object instance works fine, there's no mapping for the wrapper, i think it doesn't need any

do you have an idea what's the reason of the exception?

thanks for your advice
blaf[/code]

_________________
thanks
blaf


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 06, 2008 7:53 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I don't think there is a problem with the actual select. The stacktrace seems to be related to something that i happening later (a repaint of the GUI?) that leads to a call to Session.lock() with the MyWrapper object as an argument. This will of course not work, since the lock() method requires a mapped entity (eg. the IMyBusinessObject)


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

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.