-->
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.  [ 5 posts ] 
Author Message
 Post subject: Complex database work
PostPosted: Tue May 20, 2008 10:00 am 
Beginner
Beginner

Joined: Fri May 16, 2008 3:59 pm
Posts: 30
All,

I need to do the following:

FinancialAccount table, Position table.

for each account, I want to sum up(position1+position2) all positions.

FinancialAccount FA1

position1=$45.00
position2=$35.00

update FinancialAccount FA1 with a sum of $80.00

Is Hibernate good for this, or just plain JDBC?
Sorry, just started using this.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 21, 2008 10:45 am 
Pro
Pro

Joined: Tue Jun 12, 2007 4:13 am
Posts: 209
Location: Berlin, Germany
If that's all you want to: then let the database do this for you. Neither Hibernate nor JDBC are needed for this kind of batch. Why instantiate thousands of Java objects?

Carlo


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 21, 2008 10:56 am 
Beginner
Beginner

Joined: Fri May 16, 2008 3:59 pm
Posts: 30
Are you talking about triggers and stored procedures?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 2:50 am 
Pro
Pro

Joined: Tue Jun 12, 2007 4:13 am
Posts: 209
Location: Berlin, Germany
mc1392 wrote:
Are you talking about triggers and stored procedures?

What ever you want, what ever you need...

Note that you can use native SQL from within a Hibernate session! (this first came into my mind).

Carlo


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 9:25 am 
Beginner
Beginner

Joined: Fri May 16, 2008 3:59 pm
Posts: 30
I wonder why you say Hibernate is not for this?

It is handy since I am dealing with 4 tables: ) = code generation.
It also simplifies my db code


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