Hi!
I have the problem that the following annotated class-code doesn't work. I would like to have one class generated from Hibernate-Tools, and one extended class for my own extra-class-code. Here is the code:
Code:
/**
* AppUserEntity generated by hbm2java
*/
@MappedSuperclass
@Table(name = "APP_USER", uniqueConstraints = @UniqueConstraint(columnNames = {
"CODE_TYPE", "CODE_ID" }))
public abstract class AppUserEntity extends Base implements
java.io.Serializable {
protected String codeType;
...
}
/**
* My own class for extra-class-code.
*
*/
@Entity
public class AppUser extends AppUserEntity {
private static final long serialVersionUID = 1L;
...
}
If I move the @Table property to the AppUser-class, it works. Without that, Hibernate uses "AppUser" instead of "APP_USER" for the table-name in the queries.
I know that Hibernate takes the table-name from the top of the inheritance-hierarchie, but is it somehow possible to leave all annotations in the super-class?
Regards,
Chr.