• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate -question

 
Sagar Bilgi
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,
I know Hibernate supports the concept of named queries which allows queries to live in the mapping files.

I am wondering if there is support for having queries in a seperate file altogether.I have many queries which I use in my java APIs and if I put them all in my mapping file it would become huge.

On the other hand if i put the queries in my Java files I have to recompile each time I change the query which I definitely do not like. SO...can I put the queries in a seperate file say queries.xml(probably identify that in my hibernate.cfg.xml file and refer it by some name as in the named queries concept) and refer that in my Java code? Seems like this is something that should be pretty simple and already supported. Does anyone know if its possible and if so how to do that?

Thanks
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not place them directly into the hibernate.cfg.xml or in each mapping xml?

./pope
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic