Originally posted by Gian Franco Casula: Does Hibernate 'impose' a strict object oriented view of the database? I mean, can't I just peek into a database table in the old fashioned way but using Hibernate?
Hi Gian, If you just peek into a databse table, you can't apply the OO Concept from your peeking... By using Hibernate, you can get advantages of OO from it, which are mapped to the ralational database... For instance, reusability, inheritence and so on...
Originally posted by Ali Pope: Is your question asking about Hibernate allowing to use normal SQL statements? If yes, than the answer is yes too. Hibernate Session offers the means to execute normal SQL querying.
In hibernate use MUST USE "Hibernate Query Language[HQL]"
Hibernate Query Language[HQL] designed as a "minimal" object-oriented extension to SQL, provides an elegant bridge between the object and relational worlds"
Java Developer, Thailand
Joined: Dec 16, 2003
My understanding is that you can use HQL, but can use vendor SQL as well.
I guess this is done in order to allow programmers to use a vendor's SQL peculiarities if necessary.
I like to say that Hibernate unifies relational querying with object modelling.
So no, it is not "strict" OO in the sense that it has no concepts from outside the OO mindset. Hopefully, Hibernate helps you think about your data in both ways, by easing the conceptual gap between the two models.
Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/193239415X/ref=jranch-20" target="_blank" rel="nofollow">Hibernate in Action</a>