How to create composite key in hibernate using annotations?



How to create composite key in hibernate using annotations?..

Answer / Ajay Chauhan

In Hibernate, you can define a composite primary key using the @IdClass annotation on the entity class and @Id annotations on the fields that make up the composite key.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

Explain about hibernate proxy and how it helps in lazy loading?

1 Answers  


What is the difference between lazy and eager loading in hibernate?

1 Answers  


What is getcurrentsession in hibernate?

1 Answers  


What is unidirectional and bidirectional in hibernate?

1 Answers  


How many attributes are there in column annotation?

1 Answers  


What is difference between first level cache and second level cache?

1 Answers  


What is the difference between an orm and an odm?

1 Answers  


What are the advantages of using hibernate over jdbc?

1 Answers  


What happens if hibernate session is not closed?

1 Answers  


What is automatic dirty checking in hibernate?

1 Answers  


What is purpose of hibernate?

1 Answers  


What is the hibernate life cycle of an entity?

1 Answers  


Categories