Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HQL problem

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


is this example HQL is rom Insurance insurance.
my problem is it is leagel or not?
there is no select part?
 
Charan kumar sarvepalli
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is legal HQL query "from Insurance insurance"

if you configure show_sql to true in hibernate.cfg.xml, you can see a SQL query on console fired by Hibernate with all the properties in the Insurance class.

if you want only specific properties (columns) you need to use the "select.." clause.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just so you don't experience too much confusion, I would strongly recommend not using the roseindia tutorials. We see numerous questions here arising from buggy examples coming from that source. The best place to find out about HQL is the Hibernate documentation. If you have not already done this I would take some time to read it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic