Hibernate version: 3.2.5
I am trying to map a class into 2 different tables. Official tutorial shows a mappig file example, but I don't know which is the best way to set the entity name. Currently I am using a SaveOrUpdateEventListener, and I set the entity name in the onSaveOrUpdate method:
Code:
@Override
public void onSaveOrUpdate(SaveOrUpdateEvent event) throws HibernateException {
Object objeto = event.getObject();
if (objeto instanceof CarOption) {
event.setEntityName("implementedOption");
}
}
Is that the preferred way to set entity name, or there is a more common one?