• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Considering Hibernate Please help

 
Prem Khan
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can Hibernate do every kind of query that is done with out a Object layer ? Such as Outer Joins agregates, Max Sum Having Group by Order By Distinct.... Decode... Union

Must it be given datasource code or Is it setup in a config file ?
Can it use the tomcat connection pooling ?

One Class per DB table for more that one ?

Ant build for the Classes ?
 
Jack Wiesenthaler
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, HQL has support to do all that and a lot more.

The datasource is specified in the hibernate config file. If you're using DBCP with Tomcat then just specify the JNDI address in the connection.datasource property.

I'm not sure what you mean by "more than one class per table" ?
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you mean by "more than one class per table" ?

yes, one table two classes: hibernate calls it component

you get Person and Adress in the very same table and map Adress as a component of Person

as to ant, i dont get what you mean
 
Pj Murray
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shawn DeSarkar:

Ant build for the Classes ?



Do you mean that you want to use Ant tasks to generate the Hibernate persistent classes?

This is possible if you use an appropriate tool.

You can look here for an example of such a tool:

http://www.codefutures.com/hibernate


I hope this helps: My answer may be way off since I'm just guessing what you want. It's a case of "garbage in - garbage out". You can maximize your chances of getting the answer you want from a forum by providing as much information as possible.
 
Prem Khan
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean that you want to use Ant tasks to generate the Hibernate persistent classes?
 
Prem Khan
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
?
Do you mean that you want to use Ant tasks to generate the Hibernate persistent classes


I was just wondering what the standard way of building them is.
Are they created at run time ? Or precompiled ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate uses what are called POJOs, which is an abreviation for Plain Old Java Ojects, or simle Java classes. You can build them any way you feel comfortable, just as you would any Java class. (Ant, javac, an IDE etc.)

However, creating these POJOs presents some options: you can write them by hand, use the Hibernate extensions to generate them, or use another generation tool, such as the one mentioned by P.J.Murray (I've never used it, so I can't tell you if its any good. You'll have to find out for yourself if you wish).

Hibernate also requires mapping classes to be associated with the
se POJOs. These too are a good candidate to be created automatically by some kind of tool.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic