-->
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: <any> mapping and HQL
PostPosted: Fri Feb 03, 2006 6:27 am 
Newbie

Joined: Wed Feb 01, 2006 6:49 am
Posts: 5
Use an element mapped as <any> in HQL

Hibernate version: 3.1
Name and version of the database you are using: Oracle 10g

Mapping documents:
<class name="AuditRequest" ...>
...
<any name="targetEntity" id-type="long" meta-type="string" >
<meta-value value="A" class="Area" </>
<meta-value value="R" class="Role" </>
<column name="ENTITY_TYPE" />
<column name="ENTITY_ID" />
</any>
</class>

HQL request:
Code:
from AuditRequest req
where req.targetEntity.class = :entityClass
and req.targetEntity.id = :entityId


I would like to pass 'Area' or 'Role' value for the entityClass named parameter.
But, rows are returned when the meta-value is set for entityClass . ('A' or 'R' in the example.
How could I use the class name in the HQL ?

Note : I use here the syntax as defined by Hibernate documentation reference: 3.1 - page 146.

Thanks for help.


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.