@Embedded and @Embeddable Example in Hibernate

The Embedded and Embeddable Example in Hibernate

In this tutorial, I am attaching simple application about, usage of Embedded and Embeddable Example in Hibernate framework. The application were tested with MySQL database environment and shared in the same post.

Project Structure

Embedded and Embeddable Example in Hibernate

@Embeddable

Address.java

@Embedded

Customer.java

Getting Session for Transaction

SessionProvider.java

CustomerApplication.java

Output

Embedded and Embeddable Example

References

1. Hibernate 4.3 JavaDoc
2. JPA 2.1 Embeddable JavaDoc
3. JPA 2.1 Embedded JavaDoc