Last active
May 25, 2016 12:49
-
-
Save nakamura-to/2cb693c0f720437176ab3e14e9443d3a to your computer and use it in GitHub Desktop.
Embeddable support in Doma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
public Person { | |
@Id | |
public Integer id; | |
public String name; | |
public Address address; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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