Skip to content

Instantly share code, notes, and snippets.

@nakamura-to
Last active May 25, 2016 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nakamura-to/2cb693c0f720437176ab3e14e9443d3a to your computer and use it in GitHub Desktop.
Save nakamura-to/2cb693c0f720437176ab3e14e9443d3a to your computer and use it in GitHub Desktop.
Embeddable support in Doma
@Embeddable
public class Address {
private final String city;
private final String street;
public Address(String city, String street) {
this.city = city;
this.street = street;
}
public String getCity() {
return city;
}
public String getStreet() {
return street;
}
}
@Entity
public Person {
@Id
public Integer id;
public String name;
public Address address;
}
create table person (
id int primary key,
name varchar(100),
city varchar(100),
street varchar(100)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment