>>
This is something I've been trying to sort out for a while - 
every now and then it catches me out and I waste time tracking 
down my error to the omission of a new entity mapping file from 
one of the persistence units in my persistence.xml. 

Below, it's suggested that I can feed JPA the list of mapping files 
via the EntityManagerFactory.createEntityManager() method. I tried 
this out with no success. I doesn't seem possible, surely?

The alternative is to use XML entities - has anybody done this with 
success?

Thanks
Adam

Patrick Linskey <[EMAIL PROTECTED]> writes:
> 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
> >
> 




Reply via email to