-->
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: Why don't HibernateTools don't export queries to @NamedQuery
PostPosted: Sat May 07, 2011 10:06 pm 
Newbie

Joined: Sat May 07, 2011 9:56 pm
Posts: 7
Hi,

I'm trying to start using annotations for NamedQueries instead of using hbm.xml files, however, I am running into a significant issue here. I've been using the HibernateTools eclipse plugin to generate Entity Types/Models, but I am running into a significant issue. From what I understand about JPA and NamedQueries, the annotation has to be part of the @Entity class. However, if I add named queries to the entity model, and then need to regenerate my entity (new fields, etc in the hbm file), then I end up losing all my named queries.

I tried adding the queries to the hbm file, expecting them to be generated as annotations in the entity model, but they weren't inserted there.

Is it just me, or am I missing something in the configuration? I have trouble believing that this is the way the Hibernate Tools and named queries are supposed to work.

Is there way I can put my NamedQueries in some other class (ex: my DAO class)?

Thanks,

Eric


Top
 Profile  
 
 Post subject: Re: Why don't HibernateTools don't export queries to @NamedQuery
PostPosted: Tue May 10, 2011 7:12 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
benze,
could you please create an issue in jboss jira (https://issues.jboss.org/secure/CreateI ... ate=Create) with minimal entity/hbm example and steps to reproduce?


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.