-->
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: SQL to Criteria Query
PostPosted: Tue Feb 12, 2008 12:05 pm 
Newbie

Joined: Mon Feb 04, 2008 7:42 am
Posts: 7
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2.5

I am trying to recreate an SQL query using a Criteria query and was hoping someone could help.

The SQL is:
Code:
SELECT HTL_HOTELS.HOTL_ID
FROM HTL_HOTELS, LOCATIONS, LOC_LOCATION_NAMES
WHERE HTL_HOTELS.HOTL_LOCATION_ID = LOCATIONS.LOCATION_ID
AND LOCATIONS.LOCATION_ID = LOC_LOCATION_NAMES.LOCATION_ID
AND LOC_LOCATION_NAMES.LOCATION_NAME LIKE 'Fukuo%'


And I have the schema mapped as followed:
- HTL_HOTELS table -> Hotel.java
- LOCATIONS table -> Location.java
- LOC_LOCATION_NAMES table -> LocationName.java

where
- a Hotel.java object has a Location.java field
- a Location.java object has a set of LocationName objects

Any help much appreciated


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.