@Embeddable annotation is used on a class whose instances are stored as a part of an owning entity. Each of the persistent properties or fields of the embedded object is mapped to the database table for the owner entity.
package com.logicbig.example;
import javax.persistence.Embeddable;
@Embeddable public class ClassA { private String myStr; private int myInt;
public String getMyStr() { return myStr; }
public void setMyStr(String myStr) { this.myStr = myStr; }
public int getMyInt() { return myInt; }
public void setMyInt(int myInt) { this.myInt = myInt; }