Results 1 to 3 of 3

Thread: Hibernate

  1. #1
    Alan is offline Member
    Join Date
    May 2007
    Rep Power

    Default 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 ();
    ModulosDAO dao = new ModulosDAO(session);
    List modulos=null;
    try {
    modulos = dao.getModulos(idProject,modulosID);
    catch (Exception ex) {
    return modulos;

    public List getModulos(String project,Long[] modulosID) throws HibernateException {

    Query query = session.createQuery("select FROM Model.Module M where"+project+" and in (:modulosID) order by")
    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 01:37 AM.

  2. #2
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Rep Power


    Is your secondary level cache enabled ? Disable and try

  3. #3
    Freddie is offline Member
    Join Date
    May 2007
    Rep Power


    First, use parameters for all the parameters,don't join the project there in the query, do like list (only that you use setParameter instead of etParameterList). Anyway it isn't your problem.
    Also you shoud handle the transaction, notice that your open it but you never close it
    read this:
    HIBERNATE - Relational Persistence for Idiomatic Java
    Last edited by Freddie; 06-01-2007 at 02:33 PM.

Similar Threads

  1. Hibernate, help me
    By Nick15 in forum JDBC
    Replies: 2
    Last Post: 06-05-2008, 03:39 PM
  2. Hibernate sql query
    By taicode in forum JDBC
    Replies: 0
    Last Post: 03-25-2008, 05:17 PM
  3. question about hibernate
    By bbq in forum JDBC
    Replies: 1
    Last Post: 07-09-2007, 04:04 AM
  4. Replies: 2
    Last Post: 06-30-2007, 03:01 PM
  5. Hibernate
    By Shuru in forum JDBC
    Replies: 2
    Last Post: 05-09-2007, 05:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts