Embeddable Classes
  • An entity may "embed" other objects
  • Embedded objects are not entities; they do not have identity
  • Fields are typically stored in-line (same table) in the database
Embeddable Class Example  
  @Embeddable
  public class Address {
    private String address1, address2, city, state, zip;
    ...
    //Getters/Setters
    ...
  }

  @Entity
  public class Employee {
    
    private Address address;
    
    ...
    public Address getAddress() {
      return address;
    }
    ...
  }