This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

hibernate criteria does not return any values

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to retrieve data using hibernate criteria in my Spring application. I had it working with a query in the hbm file but I need to use the hibernate criteria. I am passing one of the values for the Family class (Lastname = "Jones").
Here is part of my service code:

SessionFactory sessionFactory = new Configuration().configure()
.buildSessionFactory();

Session session = sessionFactory.openSession();
Criteria criteria = session.createCriteria(Family.class);
families = (List<Family>) criteria.list();

I check the session and it is created. I also set the property below
<property name="hibernate.show_sql">true</property>

in hibernate.cfg.xml and set log4j to debug for hibernate. Trouble is that I do not see the query in my console and I don't see any results.

Please let me know if there some setup I am missing or any suggestion for debuggin this.

Thanks!!
 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic