I still don't quite understand the problem.
What is the difference between those moments? How does your environment change
that at the last moment the entity suddenly appears available?
You can't define PUs with the same name that have the same visibility - they'll
conflict with each other, but you can define a single PU in one place and
reference all those jars. What you can try to do (*warning*: this is not
required by the spec to be supported in Java SE, so there is no guarantee that
all persistence implementations will support this solution), is to create
META-INF/orm.xml in each jar that defines all the persistence metadata (instead
or as a duplicate of the annotations) for all entities. This metadata will
implicitly define the list of entities.
regards,
-marina
glassfish_at_javadesktop.org wrote:
> What bothers me with current mechanism is because valid entities are said to be non-entities when persisting, just because they were not declared. This is very limitating and frustrating.
> If the API has to do the scan at one moment, why doesn't it test for entities at last moment?
>
> I tried having persistence.xml files defining units of same name in multiple jars (in each module, in fact), but it did not help. That would at least have been a palliative.
>
> Is there a way to declare a persistent unit out of an xml file? Eventually, i can declare all jars of the application (once netbeans is loaded, i can trick to get the jar names of all modules), but i don't think i will be able to write a pu anywhere it could be found. Being able to declare by hand, programmatically, could be a workaround.
>
> Thanks for your answers.
> [Message sent by forum member 'pepe' (pepe)]
>
> http://forums.java.net/jive/thread.jspa?messageID=204931
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>