-
-
Save emmanuelbernard/6391475 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
class Address { | |
... | |
@Convert(...) private String city; | |
} | |
@Entity | |
@Convert(attributeName="homeAddress.city", disableConversion=true) | |
class Person { | |
... | |
private Address homeAddress; | |
} | |
This file contains hidden or 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 class="Person"> | |
<attributes> | |
<embedded name="homeAddress"> | |
<convert attributeName="city" .../> | |
</embedded> | |
</attributes> | |
</entity> |
This file contains hidden or 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
//as if the XML mapping was done in annotations | |
@Embeddable | |
class Address { | |
... | |
@Convert(...) private String city; | |
} | |
@Entity | |
@Convert(attributeName="homeAddress.city", disableConversion=true) | |
class Person { | |
@Convert(...) | |
private Address homeAddress; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment