-->
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: Questions mount as a criteria where I join an object outside
PostPosted: Mon Feb 02, 2009 4:53 pm 
Newbie

Joined: Tue Jan 13, 2009 11:04 am
Posts: 13
Questions mount as a criteria where I join an object outside of the object what to do?


I'm trying to do a query using criteria where my class master


Criteria criteria = session.createCriteria (EstoqueItem, EstoqueItem);


and try to get all the records where the field name EstoqueItem
the object model equal "LG"


but is giving me error:




[code]
between creating an alias but no model of the object EstoqueItem what to do ?????

Criteria criteria = session.createCriteria (EstoqueItem, EstoqueItem);
if (detail.getColumn (). equals ( "name")) (
criteria.createCriteria ( "device", "device");
/ / Device X Stock Item
criteria.add (Restrictions.eqProperty ( "device" +. "id", classTableMaster.getSimpleName (). toLowerCase ()+". device "));
/ / Device device_model X
criteria.add (Restrictions.eqProperty ( "device" + ". model", detail.getClassTableName ()+". id "));
/ / value of the object model atr
criteria.add (Restrictions.eq (detail.getClassTableName ()+"."+ detail.getColumn (), detail.getValue ()));
)





= Org.hibernate.QueryException Error: could not resolve property: model of: br.com.EstoqueItem
[/ code]

[code]





class EstoqueItem (

private int id

private Device device;


)



class Device (


private int id;
private Model model;

)


class Template (


private int id;
private String name;

)





[/ code]


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.