-->
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: How to use nested properties in Expression.Or
PostPosted: Fri Jan 11, 2008 3:58 am 
Newbie

Joined: Fri Jan 11, 2008 3:44 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:1.2.0.4000

Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

I want to write criteria with Expression.Or with nested properties.

Ex: There is a class "Employee" which has properties "Name" and "HomeAddress".
There is another class for "Address" and that has a property "Street"

I want to write a criterial like

.....
....
Expression.or
(Expression.eq("Name","John"),
Expression.eq("HomeAddress.Street","Some Street")));

Here nested property is "HomeAddress.Street".

Thanks in advance for any help regarding this.

Chamara


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 6:49 am 
Regular
Regular

Joined: Wed Jan 25, 2006 1:11 am
Posts: 118
Location: Copenhagen, Denmark
Take a look at the CreateAlias on your query


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.