Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate - dynamic queries created by the user?  RSS feed

 
John Anaivs
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello people,

I am facing a design issue in the system we are developing. There is a use case where the User has to create dynamic queries that will generate objects to be used thoughtout the system. How the user can do it in a system based on Hibernate?

Thank you very much for any thoughts.
 
Halcon Guatemala
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi nato, I see You aren't a dummy as I am.

How the user can do it in a system based on Hibernate?


The question is How will nato code it?
I believe Criteria API is adequate for you, letting you dinamically create criterias in runtime and avoiding write code for to create HQL query

I hope it helps.
 
John Anaivs
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Halcon. I'll take a look on it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!