-->
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 et requête HQL
PostPosted: Wed Feb 01, 2006 9:45 am 
Newbie

Joined: Wed Feb 01, 2006 6:49 am
Posts: 5
Utiliser un élement mapper en tant que <any> dans une requête HQL.

Hibernate version: 3.1

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


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


Des lignes sont retournées lorsque pour entityClass est passée une valeur de type meta et non la classe. Exemple : si A est passée et non la classe Area
Est-il possible d'utiliser le nom de la classe comme paramètre qui est connu et non la meta-value de l'élément <any> qui n'est défini que dans le fichier de mapping ?

Hibernate documentation reference: 3.1 - page 152
Cela semble possible d'après ce paragraphe...


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.