Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] crossing entity managers?

It's actually the former case. We have multiple modules, each with their own persistence.xml and entities. But now they need to query across one another. Other ORM technologies that I have used in the past allow you to "merge" the equivalent of the persistence.xml files. I got around it by adding all the entities to one big persistence.xml, but that just seemed hacky.


Tim Hollosy wrote:
I'm not following - are you using multiple persistence.xml's?

Or do you just have a few DAO classes that all use @PersitenceContext?

If it's the latter, that's the normal usage as I understand so how are
you coming to the conclusion that some classes can't make certain
queries because they don't have the "right" EntityManager?

Perhaps you're running into the problem that you're trying to work
with unmanaged Entities?


On Tue, Oct 7, 2008 at 9:21 AM, natjohns <natjohns@xxxxxxxxxxx> wrote:
Hi all,

I've got multiple spring files wiring up sets of entities. They each use the
auto-injection of Persistence Contexts like this:


Now I am running into the problem that some classes can not make certain
queries because they don't have the right entity manager. Is there an easy
way to combine all entity managers and have a single point that knows about
all entities?

eclipselink-users mailing list

eclipselink-users mailing list

Nathaniel A. Johnson
Principal Systems Analyst
Enterprise Services Integration
Division of Enterprise Software
Indiana University

Back to the top