-->
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: createQuery and createCriteria
PostPosted: Mon Mar 14, 2005 2:58 am 
Newbie

Joined: Fri Feb 18, 2005 9:23 am
Posts: 10
The code given below works

Query query = session.createQuery(findTokens);
Date d1 =Date.valueOf("2005-03-10");
query.setDate( "processInstanceStart", d1);
query.setString( "actorId", actorId );


but when i specify this with criteria it fails

classCriteria crit = session.createCriteria(TokenImpl.class );
Criterion userEq=Expression.eq("actorId",actorId);
crit.add(userEq);
Date d1 =Date.valueOf("2005-03-10");
Criterion processInstanceStartEq=Expression.eq("processInstance.start",d1);
crit.add(processInstanceStartEq);


the query goes like this
private static final String findTokens =
"select t " +
"from t in class org.jbpm.model.execution.impl.TokenImpl " +
"where t.processInstance.start >:processInstanceStart " +
" and t.actorId = :actorId ";

is there any thing wrong with my criteria expression


thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 3:01 am 
Newbie

Joined: Fri Feb 18, 2005 9:23 am
Posts: 10
sorry there is a small change in the query

private static final String findTokens =
"select t " +
"from t in class org.jbpm.model.execution.impl.TokenImpl " +
"where t.processInstance.start =:processInstanceStart " +
" and t.actorId = :actorId ";



Thanks


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.