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.  [ 5 posts ] 
Author Message
 Post subject: NamedQuery possible location
PostPosted: Wed May 28, 2008 11:25 am 
Newbie

Joined: Tue May 22, 2007 3:39 am
Posts: 15
Hello,

In Our project we have about 10 branches. I would like move all NamedQuery to separate one file for each branch.
Is possible locate NamedQuery in not domain file ?


regard
gienas


Top
 Profile  
 
 Post subject: Re: NamedQuery possible location
PostPosted: Wed May 28, 2008 12:42 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
gienas wrote:
Is possible locate NamedQuery in not domain file ?


Hmm, you could always store HQL queries in a text file and read them as you wish. Hibernate API has enough methods for running a HQL.


Farzad-


Top
 Profile  
 
 Post subject: Re: NamedQuery possible location
PostPosted: Wed May 28, 2008 4:08 pm 
Newbie

Joined: Tue May 22, 2007 3:39 am
Posts: 15
Quote:
Hmm, you could always storueries in a text file and read thee HQL qm as you wish. Hibernate API has enough methods for running a HQL.


Yes but I would like benefit from syntax check what HB do during set up.


Top
 Profile  
 
 Post subject: Re: NamedQuery possible location
PostPosted: Thu May 29, 2008 11:38 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
gienas wrote:
Yes but I would like benefit from syntax check what HB do during set up.



Write some test cases and put it in your build process so that no bad query gets passed.


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 29, 2008 4:26 pm 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
if they're in separate branches just put the different queries in each branch and don't merge that file up.

Just put them all in a single hbm.xml file and as long as your sessionFactory knows about that file it'll read them in. It doesn't have to be in a file with a class mapping or anything.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.