-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Template
PostPosted: Sat Mar 10, 2012 4:20 am 
Newbie

Joined: Sat Mar 10, 2012 4:16 am
Posts: 1
I have sound knowledge in Spring MVC and spring Jdbctemplate. But, I am a beginner in hibernate.
I was trying to develop a shopping cart application and using hibernate template to persist data in mysql. I don't know how to execute this query using hibernate template -

select o.user_id,u.address,u.ph_no,o.product_id,i.product_name,i.product_desc,i.product_price from user_ids u,items_avlbl i,order_details o where u.user_id=o.user_id and i.product_id=o.product_id;

[where SignUpHIB is the pojo name for table user_ids]
[ItemsAvlblHIB is the pojo name for table items_avlbl]
[OrderDetailsHIB is the pojo name for table order_details ]


It's very simple to execute this statement using spring jdbctemplate.queryForObject(......sql query).

But, I have no clue how to execute this in hibernate template.
Any help will be appreciated


Top
 Profile  
 
 Post subject: Re: Hibernate Template
PostPosted: Mon Mar 12, 2012 3:29 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
hibernatesession.createSQLQuery("select o.user_id,u.address,u.ph_no,o.product_id,i.product_name,i.product_desc,i.product_price from user_ids u,items_avlbl i,order_details o where u.user_id=o.user_id and i.product_id=o.product_id").list();


Top
 Profile  
 
 Post subject: Re: Hibernate Template
PostPosted: Mon Mar 12, 2012 5:09 am 
Newbie

Joined: Mon Mar 12, 2012 5:01 am
Posts: 3
When I try to subclass the composite subclass like this ( I just show the relevant things):





------------------------------------------------------------------------------------------
Trumpet Wedding Dresses|New Style Wedding Dresses|Wedding Dresses with Sleeves|New Style Flower Girl Dresses


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