Write a code to do the component mapping in hibernate.



Write a code to do the component mapping in hibernate...

Answer / Vikas Kumar Rao

Component mapping is used for mapping an immutable, composited Java object as if it were a single table. Here's an example of how to use it:nn@Entitynpublic class Order {n @Idn private Long id;nn @Embeddedn private Address address;nn // constructors, getters and setters...}nn@Embeddablenpublic class Address {n private String street; n private String city; n // constructors, getters and setters...}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

Is sessionfactory singleton in hibernate?

1 Answers  


What is hibernate configuration file?

1 Answers  


What is second level cache in hibernate?

1 Answers  


What is fetch in hibernate?

1 Answers  


What is the difference between hibernate session get() and load() method?

1 Answers  


How does hibernate useful in mapping object and its relations?

1 Answers  


What is dialect in hibernate?

1 Answers  


How do you integrate hibernate with struts2 or servlet web applications?

1 Answers  


Why do you use hibernate?

1 Answers  


What is cascade in hibernate in which scenario we use it?

1 Answers  


What is the difference between unidirectional and bidirectional hibernate?

1 Answers  


Is it possible to perform collection mapping with one-to-one and many-to-one?

1 Answers  


Categories