permaculture playing cards*
The moose likes Object Relational Mapping and the fly likes Where are hibernate queries generally maintained Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Where are hibernate queries generally maintained" Watch "Where are hibernate queries generally maintained" New topic
Author

Where are hibernate queries generally maintained

Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
I see that queries can be defined directly in the code instead of the descriptor in case of entity beans. We had this tendency to maintain jdbc queries in a properties file and then look it up using some Factory class?
How do people normally code their queries in hibernate...?
If the hibernate query gets mixed with business logic then that w'dnt look neat either.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
We use 2 techniques:
- either directly HQL querying
- either named queries (defined in the mapping)


blog - InfoQ.com
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Ali Pope:
- either named queries (defined in the mapping)




How to definded in mapping file ?


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Read the Named query section of the tutorial
http://www.warfrog.com/hibernatetutorial/


Groovy
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where are hibernate queries generally maintained