Created
April 9, 2012 19:00
-
-
Save roalcantara/2345556 to your computer and use it in GitHub Desktop.
JAVA > Hibernate > @Embedded > Custom Column Names
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 | |
public class Phone { | |
private String number; | |
private String extensionNumber; | |
//ctors | |
//getters/setters | |
} | |
public class Sample { | |
@Embedded | |
private Phone phone; | |
@Embedded | |
@AttributeOverrides({ | |
@AttributeOverride(name="number", column = @Column(name="faxNumber")), | |
@AttributeOverride(name="extensionNumber", column = @Column(name="faxExtensionNumber")) | |
}) | |
private Phone fax; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment