-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Annotated Entities with Externalized Named Queries - How to?
PostPosted: Tue Nov 03, 2009 3:09 pm 
Newbie

Joined: Tue Nov 03, 2009 2:54 pm
Posts: 4
Hello world!

I have a project in which I have all of my mappings configured with annotations and everything works great! I love the annotations. However, I don't like using @NamedQuery for my named queries. Does anyone have an example of how to configure everything with Annotations except for the Named Queries? Ultimately I would like to have one xml file that contains all the named queries for my application. How would I do that?

Thanks,
Hibernate Newbie.


Top
 Profile  
 
 Post subject: Re: Annotated Entities with Externalized Named Queries - How to?
PostPosted: Wed Nov 04, 2009 7:56 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
Just set the property "hibernate.archive.autodetection" to "class hbm" in your persistence.xml (or hibernate.cfg.xml if not using JPA).
Then you can also place a *.hbm.xml file in your archive where you can define named-queries.

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.