I want to have a feature that the main application is totaly unaware of. To achieve this I am working with AOP.
I would like to add an Entity but I don't want to place it in the main jar where all other entities are. This main jar holds a Persistance Unit which I want to extend. So I tried to place the additional entity in another jar file and set the name of persistence unit the same as for my main unit. This resultet in error:
... references an unknown entity: ...
Although this is not a surprise for me I wonder if there is some way to achieve what I want.
According to specification I could divide a Persistance Unit among many jars as long as they would reside in a single ear file. This is not a solution for me. My feature must be able to be added on runtime (extend the running app by puting a extension jar to deploy directory of jboss).