adspace
Write a code to do the component mapping in hibernate.
Answer Posted / 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 View All Answers