-->
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: queries with "select new" can't using in more than
PostPosted: Mon Apr 12, 2004 6:28 am 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
queries with "select new" now cacheable
---------- it can't using in more than one table?

====================================

i want do :
Query query = ss.createQuery("select new SectionalFields(a.x,b.y) from A a, B b");

============================

problem 1:

For using Class "SectionalFields", we must write codes "<import class="SectionalFields"/>" in *.hbm.xml

if i only do "select new SectionalField2(a.x) from A a", it has no problem.
but i want select fields from more than 1 table.
so i write "<import class="SectionalFields"/>" in A.hbm.xml and B.hbm.xml

error: duplicable import class SectionalFields

==========

problem 2:

because of problem 1, i only write "<import class="SectionalFields"/>"
in A.hbm.xml or B.hbm.xml
but it can's pass!!!!

==================================
what's the problem? for queries with "select new" can't using in more than 1 table? Or i've done some wrong??

_________________
I am the creatxr of world.


Top
 Profile  
 
 Post subject: Re: queries with "select new" can't using in more
PostPosted: Mon Apr 12, 2004 6:29 am 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
worldcreatxr wrote:
queries with "select new" now cacheable
---------- it can't using in more than one table?

====================================

i want do :
Query query = ss.createQuery("select new SectionalFields(a.x,b.y) from A a, B b");

============================

problem 1:

For using Class "SectionalFields", we must write codes "<import class="SectionalFields"/>" in *.hbm.xml

if i only do "select new SectionalField2(a.x) from A a", it has no problem.
but i want select fields from more than 1 table.
so i write "<import class="SectionalFields"/>" in A.hbm.xml and B.hbm.xml

error: duplicable import class SectionalFields

==========

problem 2:

because of problem 1, i only write "<import class="SectionalFields"/>"
in A.hbm.xml or B.hbm.xml
but it can's pass!!!!

==================================
what's the problem? for queries with "select new" can't using in more than 1 table? Or i've done some wrong??

_________________
I am the creatxr of world.


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.