D
deno.vichas
i've just started working with hibernate and i want to create a generic
method that will take a class and id and pass back an object of the
type class i've passed to it. here' what i've got so far. i now it's
not correct but i'm not sure how to fix it. could somebody help me
with this along with pointing me to some docs on how to.
public <T> Class<T> getById(Class<T> mappedClss, long id) {
Session session = getSession();
Class<T> object = (Class<T>) session.get(mappedClss, id);
return object;
}
thanks,
deno
method that will take a class and id and pass back an object of the
type class i've passed to it. here' what i've got so far. i now it's
not correct but i'm not sure how to fix it. could somebody help me
with this along with pointing me to some docs on how to.
public <T> Class<T> getById(Class<T> mappedClss, long id) {
Session session = getSession();
Class<T> object = (Class<T>) session.get(mappedClss, id);
return object;
}
thanks,
deno