Problem with query <SELECT FROM de.hsowl.google.evaluation.model.Appointment WHERE userPara == createdBy PARAMETERS String userPara>: Unexpected expression type while parsing query: org.datanucleus.query.expression.ParameterExpression
public List<Appointment> getAppointments(User user)
{
PersistenceManager pm = PMF.get().getPersistenceManager();
Query q = pm.newQuery(Appointment.class);
q.setFilter("userPara == createdBy");
q.declareParameters("String userPara");
List<Appointment> queryResult = (List<Appointment>) q.execute(user.getUserId());
return queryResult;
}
@PersistenceCapable(detachable = "true")public class Appointment implements javax.jdo.listener.StoreCallback{ @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id;
@Persistent
private String createdBy; //contains the userid...
}