OK, I hadn't thought of an XML technique for this.
Regarding the EntityManagerFactory.createEntityManager(String puName, Map props)
call, are you saying that I can pass in the mapping file names as map entries
with the key 'mapping'?
I hadn't thought of trying that even since the <mapping> node in persistence.xml
is not a child of the <properties> node.
Regards
Adam
Patrick Linskey on 29/10/07 17:14, wrote:
Hi,
You can do this with the
EntityManagerFactory.createEntityManager(String puName, Map props)
signature.
Alternately, you can use XML entities to define the shared mappings
outside of your persistence units and refer to them in multiple
places.
-Patrick
On 10/29/07, Adam Hardy <[EMAIL PROTECTED]> wrote:
Hi List,
I am running JPA with a set of mapping files, one for each table in the database
plus a few for queries, and in my test environment I have additional mapping
files that aren't required in container and in fact I would like to exclude.
So I made a second test persistence.xml and now I find though that I have to
maintain 2 lists of mapping files.
I would like to initialize the entity manager factory programmatically to add
the main list of mapping files, and then in testing, to add the extra mapping
files as well.
There seems to be no method on the API where I do that programmatically though.
Is that correct or have I overlooked something?
Regards
Adam