}
return null;
}
public Userdata getUserdataByKey(Long user_id, String DATA_KEY) {
Userdata userdata = new Userdata();
if (user_id.longValue() > 0) {
try {
TypedQuery<Userdata> query = em
.createQuery("select c from Userdata as c where c.user_id = :user_id AND c.data_key = :data_key AND c.deleted <> :deleted", Userdata.class);
query.setParameter("user_id", user_id.longValue());
query.setParameter("data_key", DATA_KEY);
query.setParameter("deleted", true);
for (Iterator<Userdata> it2 = query.getResultList().iterator(); it2
.hasNext();) {
userdata = it2.next();
}
} catch (Exception ex2) {
log.error("getUserdataByKey", ex2);
}
} else {
userdata.setComment("Error: No USER_ID given");
}
return userdata;
}