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.

Nate


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?

./tch



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:

<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>

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?

Nate
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

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


Back to the top