So I guess your answer is: No, you can't use entity listeners to implement this.
Whilst I take your point about development costs I would still like to see a couple of things from the EJB3 community which addresses these issues in the long run:
- Support for the definition of user-defined id generators.
- Clarification of the expected behavior of the entity manager and the calling of entity listeners - for example there is nothing in the spec that says an entity manager should perform validation of the entities before calling prePersist().
The other thing is I'm not using annotations, I'm using mapping files. If I were using annotations then it is perhaps no big deal to mix the odd vendor-specific annotation in with the standard ones. If I'm using mapping files though, I'm assuming that I would have to define the entire mapping of each affected entity in a vendor-specific mapping file?[/list]