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??