-->
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: How to Create Criteria From Other Table
PostPosted: Fri Feb 27, 2009 1:17 am 
Newbie

Joined: Fri Feb 27, 2009 12:56 am
Posts: 1
Location: Bandung
Hello, i have problem with restriction in hibernate.
This is my problem.
I want to create the createria so that i can print out data which have this criteria
Price under 400USD and Supplier is MySupplierName.
But the price column is placed in Product table and Supplier Name column is placed in Supplier table. How i can grab such data like i want with these criteria?
This is the complete table structure per table which i had.

Table Product
ID
Product Name
Description
Price
Supplier_ID

Table Supplier
ID
Supplier Name

I generate the id of product table with increment class in my mapping xml likewise my supplier table id. I generate supplier id in mapping sql.

So how i can create the criteria with that specification, price from product table and supplier name from supplier table.

Oh...is anybody can give me some simple code?
(Code which coded in netbean is preferable)

Ok. I very - very needs your help. Thanks.
May God bless you.

_________________
Otniel Simbolon is My Name


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.