[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] Hierarchy listener

I need to listen to a change of a persistence hierarchy in a certain JPA project. For example if Entity1 extends MappedSuperclass1 and I delete the ‘extends’ clause of the Entity1 class definition this will change the hierarchy tree.

What Dali model listener should I use?


You can add a PropertyChangeListener to the PersistentType that listens for changes to
the property SUPER_PERSISTENT_TYPE_PROPERTY:

    persistentType.addPropertyChangeListener(PersistentType.SUPER_PERSISTENT_TYPE_PROPERTY, listener);

This is not always the immediate superclass; read the JavaDoc for
PersistentType.getSuperPersistentType().

Brian