I have a Person object with an email collection property:
@ElementCollection @CollectionTable(schema="u",name="emails", joinColumns=@JoinColumn (name="person_fk")) @AttributeOverrides({ @AttributeOverride(name="email", column=@Column (name="email",nullable=false)), }) public List<EmailU> getEmails() { return emails; }
In my email class, I tried to annotate email using @Email:
@Embeddable public class EmailU implements Serializable { private String email; public EmailU(){ } @Email public String getEmail() { return email; } }
But that will not work. What should be my approach here?
ftkg
source share