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: Class as a named parameter
PostPosted: Wed Apr 13, 2005 4:15 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
I'm using the class keyword in my HQL to check the type of a table-per-class-hierarchy mapped set of classes. Hibernate correctly resolves the embedded class name to the discriminator type when I hardcode the class name.

When I use the class name as a named parameter, either as an actual Class or as a String (class.getName()), it does not behave correctly. It seems like the query engine is creating a quoted value rather than resolving the class name.

I tried specifying the type as Hibernate.custom() and that did not seem to work. Here's my query:

Code:
from eg.Order o
where o.merchant = :merchant
and exists (from o.flowInterrupts fi where fi.class = :interruptType
and fi.subType = :interruptSubType
and fi.currentStatus.status = :status)


Any ideas? Can I pass class as a named parameter?


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.