-->
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: hibernate queries with criteria
PostPosted: Fri Apr 01, 2005 11:23 am 
Newbie

Joined: Fri Apr 01, 2005 11:16 am
Posts: 1
I've a little problem using hibernate queries with the api criteria.
For a class like

public class Document{

private User owner;
private String title;
..........

}

with the classe User


public class User {

private String name;

......
}

with criteria queries i wondered if I can do something like this :
Criteria criteria = session.createCriteria(Document.class);
criteria.add(Expression.eq("owner.name", "fred"));
criteria.list();

when I try do this i've a null pointer excetion, can someon help me please?


java.lang.NullPointerException
net.sf.hibernate.persister.NormalizedEntityPersister.toColumns(NormalizedEntity Persister.java:1099)
net.sf.hibernate.expression.AbstractCriterion.getColumns(AbstractCriterion.java :35)
net.sf.hibernate.expression.IlikeExpression.toSqlString(IlikeExpression.java:32 )
net.sf.hibernate.expression.LogicalExpression.toSqlString(LogicalExpression.jav a:44)
net.sf.hibernate.expression.LogicalExpression.toSqlString(LogicalExpression.jav a:44)
net.sf.hibernate.expression.LogicalExpression.toSqlString(LogicalExpression.jav a:44)
net.sf.hibernate.expression.LogicalExpression.toSqlString(LogicalExpression.jav a:44)
net.sf.hibernate.expression.LogicalExpression.toSqlString(LogicalExpression.jav a:44)
net.sf.hibernate.expression.LogicalExpression.toSqlString(LogicalExpression.jav a:44)
net.sf.hibernate.loader.CriteriaLoader.<init>(CriteriaLoader.java:64)
net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3595)
net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)

with the attribut owner in public access I've got the same issue.
Maybe I forgot somthing in my configuration


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.