-->
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> and Hibernate.any
PostPosted: Sun Jul 11, 2004 10:57 pm 
Newbie

Joined: Sun Jul 11, 2004 12:14 pm
Posts: 2
I am trying to use <any> this way:

<class name='AuditRecord' table='AUD_RECORD'>
<id name='id' column='ID' type='long' unsaved-value='0'>
<generator class='native'/></id>
<!-- some properties -->
<any name='subject' id-type='long' meta-type='AuditTypeMapper'>
<column name='TYPE'/>
<column name='SUBJECT_ID'/>
</any>
</class>

AuditTypeMapper follows the Custom UserType pattern and returns integer

The following code is used for query:

session.find ( "FROM " + AuditRecord.class.getName() + " rec WHERE rec.subject=?", subject,
Hibernate.any(Hibernate.custom (AuditTypeMapper.class), Hibernate.LONG));

Is this correct? When I test it, it complains "path expression ends in a composite value".

What's the proper way to use Hibernate.any()? Is it necessary for I to use rec.subject.class=? AND rec.subject.id=? instead of rec.subject?

Thanks.

Albert


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.