Forums Register Login

best way for storing Java objects into DB

+Pie Number of slices to send: Send
Hello Cameron,

I have few questions regarding your book and hibernate in general.

I have done a research, a year ago, for a project. We were supposed to find the best way for storing Java objects into DB.

Hibernate had been one of our candidates but we have to drop it. Here comes few answer to the obvious question: "why?"

1. We had a lot of problems related to SQL queries that contained left, right joins - time consumption for these queries implemented with Hibernate was very high
2. The same issue we have encountered while it came to sub-queries.

Basing on my experience I have two questions regarding your book.

1. Do you cover more complicated usage of database queries than simple storing (serializing) objects? (that's what I find Hibernate very good for)
2. What, in your opinion, is the best way to implement left, right joins using Hibernate.

Thanks in advance for the answers

Cheers

Michal

[ June 04, 2008: Message edited by: kelahcim kela ]
[ June 04, 2008: Message edited by: Bear Bibeault ]
+Pie Number of slices to send: Send
 

1. Do you cover more complicated usage of database queries than simple storing (serializing) objects? (that's what I find Hibernate very good for)
2. What, in your opinion, is the best way to implement left, right joins using Hibernate.




The book does touch upon doing fairly complicated database queries with Hibenrate, with some of it done through HQL and named queries, and others covered through the use of the Hibernate Criteria APIs Example and Restrictions Criterion classes.

The nature of the beast is the fact that sometimes you'll run into queries that you know you could implement faster with JDBC or your own queries, and as such, you can issue native SQL with Hibernate, just as you can HQL queries, although the returned data isn't always as easy to work with.

Sometimes a restructuring of a database can alleviate the need for complex inner or outer joins. Sometimes a recurrence of such things might be an indication a restructuring may be in order. Of course, we don't always have that luxury. So, a solution many clients use is a combination of native SQL with Hibernate.

Hibernate, like anything else, is a tool for a particular job. But sometimes, the job at hand might be better suited for a different tool. No ORM framework is perfect for every situation, and knowing when to use Hibernate is just as important as knowing when not to use it.

-Cameron McKenzie
+Pie Number of slices to send: Send
kelahcim kela, since many of this week;s topics will be about the book "Hibernate Made Easy", using that as the title for your topic isn't the best of ideas. What if everyone asking a question about the book did so?

Please try to use more descriptive titles when posting.
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1168 times.
Similar Threads
So much on the Left Joins in Hibernate
Hibernate - Query language independency
Best practices in using Hibernate
Hibernate Hell
Persistence in the Enterprise - efficiency
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 21:04:37.