I am in the process of migrating our application to annotations, from hbm.xml mapping.
My goal was to migrate without changing the code, only adding annotations.
My first problem is that our application has a root parent class that is the parent of every hibernate entity.
that class has
private Long id = null;
private Integer version;
protected StatusEnum status = StatusEnum.ACTIVE;
protected String name = null;
Id is mapped to different columns, and uses a different Generator in different entities.
I was going to use the @AttributeOverride, but I was not sure how to do this with the generator.
the other problem is that name and status (and version probably) are not mapped in all of the xml files, so it would just return the default values. This is fine in xml because the values are not referenced in the hbm files
but when I use annotations those fields are caught by reflection.
Is there a recommended way to fix either of these issues?
thanks
Kal
|