-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate Query..
PostPosted: Sun Mar 19, 2006 4:43 am 
Newbie

Joined: Sun Mar 19, 2006 4:36 am
Posts: 1
How to write hibenrate Query for extracting column values from TWO TABLES???

Hibernate version: 3.0

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using: MSSQL Server 2000

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: Re: How to write hibenrate Query for extracting column value
PostPosted: Sun Mar 19, 2006 10:12 am 
Beginner
Beginner

Joined: Tue Jun 07, 2005 8:24 am
Posts: 33
Location: Cincinnati, OH
With Hibernate, it helps to not think of tables, but objects. What type of query do you want to perform? Can you give us an example? What fields do you want from what classes and how are the classes assocated (if at all)?


Top
 Profile  
 
 Post subject: Re: Hibernate Query..
PostPosted: Sun Mar 19, 2006 11:24 am 
Regular
Regular

Joined: Wed Feb 22, 2006 11:28 am
Posts: 65
Location: Santiago, Chile
Hello Firend:

You can use Criteria in hibernate, which allows you set diferent diferents values vof any objects attributes .

When you get recover a Object from a Criteria, you can recover a object attribute of that object. So you can see and manipule the object inside.

Request for Comments.

Regards.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 5:20 pm 
Beginner
Beginner

Joined: Thu Feb 23, 2006 11:22 am
Posts: 30
http://www.javalobby.org/articles/hibernate-query-101
Has some examples of what I think you are trying to do.. I found this to be an excellent article. I am new to hibernate but this article shows several methods for accessing multiple object (tables if you will). Also for a good article on different ways to map object you could look at
http://www-128.ibm.com/developerworks/java/library/j-hibernate/

I hope that this give you some help...

say you would not happen to have any good articles on joins would you?? ah just thought that I would ask.. That is what I am having trouble understanding..

if this is some help.. I could use a point.. if it is of help.. If not let me (us) know and I will take another shot..


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.