-->
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.  [ 1 post ] 
Author Message
 Post subject: Not mapped entity
PostPosted: Fri Jul 20, 2012 6:08 am 
Newbie

Joined: Fri Jul 20, 2012 5:46 am
Posts: 1
Hi,
I'm new of this forum and I don't know if I'm posting in the correct section.
I have a problem with an sqlquery with not mapped entity. I have two classes
Code:
public class X {
   private String name;
   private Y y= new Y();
}

public class Y{
    private String auto;
}

I have created my sql query and mapped the result with a ResultTransformer and added the addScalar to map correctly the resultSet property names as in the next code and my query is something like this:
Code:
SQLQuery query1 = session.createSQLQuery("select a.nome as name, a.auto as auto from a");
query1.setResultTransformer(new AliasToBeanResultTransformer(X.class)).addScalar("name");
actFav=query1.list();

the problem is that I'm not able to reference the attribute of Y class (auto attribute) in my query result set.
Is there a solution? Is there someone with the same problem?

thanks,
Tiziana


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

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.