|
Hibernate
I have the follow problem with hibernate when I want to get data from db.
the methods are :
public static List getModulos(String idProject,Long[] modulosID){
Session session = SEPhibernate.getSessionFactory().getCurrentSession ();
session.beginTransaction();
ModulosDAO dao = new ModulosDAO(session);
List modulos=null;
try {
modulos = dao.getModulos(idProject,modulosID);
}
catch (Exception ex) {
ex.printStackTrace();
}
session.close();
return modulos;
}
public List getModulos(String project,Long[] modulosID) throws HibernateException {
Query query = session.createQuery("select M.name FROM Model.Module M where M.project.id="+project+" and M.id in (:modulosID) order by M.name")
.setParameterList("modulosID",modulosID);
return query.list();
}
it works ok, but when I reuse the methods with other values, it doesn´t get me anything
what can I do?
Last edited by Alan : 06-01-2007 at 03:37 AM.
|