Entity « DAO « JPA Q&A

1. Get annoted hibernate tablename from POJO    stackoverflow.com

I have an entity which is declared roughly like:

@Table(name = "myUserTable")
public class User implements Serializable { ... }
I'm making a generic DAO class, and in doing so I'd like to retrieve ...

2. What's the point of having complex entity classes (in the Hibernate sense)    stackoverflow.com

Since the classic OOP model is broken anyway, despite all the goodies of ORM, why do I need to annotate the following two example attributes in my entity class: