Hello!
I try to generate my POJOS from my database with the reverse engineering tools. Then I try to extend the generated POJOS with my own classes to add some functionallity.
Here is an example of a generated POJO:
Code:
@MappedSuperclass
@Table(name = "ADDRESS")
public abstract class AddressEntity extends Base implements
java.io.Serializable {
protected AppUser appUser;
protected SocialInsurance socialInsurance;
...
And here is an example of an inherited POJO:
Code:
@Entity
@Table(name = "ADDRESS")
public class Address extends AddressEntity {
private static final long serialVersionUID = 1L;
/**
//extra methods
...
all my hibernate generated pojos have the postfix 'Entity'. In my application I would like use always the inherited POJOs, this means the generated POJOs should not be visisble to the programmers, only to the classes which inherit the generated pojos.
all the generated pojos uses the inherited classes, this means in the above example I use AppUser, and not AppUserEntity.
Now my goal is to put all the hibernate specific annotations into the generated class, e.a. @Table. Is that possible? I always get an error if I move the @Table annotation to the generated pojo.
any ideas how to make an inheritance for my pojos to get the following:
POJOEntity - generated with Hibernate Tools, holds all hibernate specific annotations.
POJO extends POJOEntity - only @Transient methods
regards,
christoph.