JDO query

public List query(UserItem user) {
List userList=null;
PersistenceManager pm = PMF.get().getPersistenceManager();

try{
Query query=pm.newQuery(UserItem.class);
query.setFilter("name==nameParam");
query.declareParameters("String nameParam");
List results=(List)query.execute(user.getName());
userList=new ArrayList();
for(UserItem u:results){
u.getAge();
userList.add(u);
}
}finally{
pm.close();
}
return userList;
}

你可能感兴趣的:(java)