How to write named query in hibernate?



How to write named query in hibernate?..

Answer / Sandeep Singh

To write a named query in Hibernate, you can define it in the entity class using the `@NamedQuery` annotation. Here is an example: `@Entityn@NamedQuery(name = "YourEntity.findAll", query = "FROM YourEntity")`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

Can we use spring data jpa without hibernate?

1 Answers  


How to add Hibernate mapping file in hibernate configuration file?

1 Answers  


What are the two mapping associations used in hibernate?

1 Answers  


What is orm navy?

1 Answers  


Explain some of the elements of hbm.xml?

1 Answers  


Explain the general flow of hibernate communication with rdbms.

1 Answers  


Describe the important interfaces of hibernate framework?

1 Answers  


What is fetching strategy in hibernate?

1 Answers  


Difference between sorted and ordered collection in hibernate?

1 Answers  


What is a configuration in hibernate?

1 Answers  


What is the difference between and merge and update?

1 Answers  


Does hibernate use jdbc?

1 Answers  


Categories