I have a class:
public class Email { private String name; private String domain; public String toString() { return name + \"@\" + domain; } } <
Well, there are a number of ways:
annotate the Email class with @Embeddable, and have:
Email
@Embeddable
@Embedded private Email email;
declare a custom value type - see here (using @Type)
@Type