Skip to main content



      Home
Home » Eclipse Projects » Dali » Shared persistence.xml
Shared persistence.xml [message #435001] Mon, 03 November 2008 12:59 Go to next message
Eclipse UserFriend
Hello,

I recently began adding WTP to some project here in my company and most of
them have shared persistence.xml.

In other words, inside a EAR packaging, I'm able to have multiple JARs
with Entities, all of them sharing a single persistence.xml located inside
a separate JAR file.

How can I achieve this using WTP?

Thanks a lot!
Re: Shared persistence.xml [message #435002 is a reply to message #435001] Thu, 06 November 2008 13:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Felipe,

Unfortunately, the Dali tools do not yet support the use case you describe
below for developing and packaging entities. Currently we require a
persistence.xml to be present in each JPA project, since we do not yet
support inter-project persistence units. If you were to set this up
currently, all of these required persistence.xml's would be packaged in
the entity JARs contained in the EAR, which would likely cause problems at
run-time.

In order to work with the current limitations, you would need to define
all of your entities in a single project, which could then be JAR'd and
packaged in an EAR.

I've entered bug 254480
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=254480) to make sure this
use case is captured.

Neil



Felipe Kamakura wrote:

> Hello,

> I recently began adding WTP to some project here in my company and most of
> them have shared persistence.xml.

> In other words, inside a EAR packaging, I'm able to have multiple JARs
> with Entities, all of them sharing a single persistence.xml located inside
> a separate JAR file.

> How can I achieve this using WTP?

> Thanks a lot!
Re: Shared persistence.xml [message #435003 is a reply to message #435002] Mon, 10 November 2008 10:14 Go to previous message
Eclipse UserFriend
Neil,

Thanks for you answer. Just to clarify my scenario, I use a shared
persistence.xml, and to facilitate, instead of listing each entity class
in the XML, I refer directly to the JAR. That's a lot practical since I
don't need to know all the entities that are being packaged.

I think that kind of support by Dali would be helpful to JEE developers.

See ya!
Re: Shared persistence.xml [message #611848 is a reply to message #435001] Thu, 06 November 2008 13:06 Go to previous message
Eclipse UserFriend
Hi Felipe,

Unfortunately, the Dali tools do not yet support the use case you describe
below for developing and packaging entities. Currently we require a
persistence.xml to be present in each JPA project, since we do not yet
support inter-project persistence units. If you were to set this up
currently, all of these required persistence.xml's would be packaged in
the entity JARs contained in the EAR, which would likely cause problems at
run-time.

In order to work with the current limitations, you would need to define
all of your entities in a single project, which could then be JAR'd and
packaged in an EAR.

I've entered bug 254480
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=254480) to make sure this
use case is captured.

Neil



Felipe Kamakura wrote:

> Hello,

> I recently began adding WTP to some project here in my company and most of
> them have shared persistence.xml.

> In other words, inside a EAR packaging, I'm able to have multiple JARs
> with Entities, all of them sharing a single persistence.xml located inside
> a separate JAR file.

> How can I achieve this using WTP?

> Thanks a lot!
Re: Shared persistence.xml [message #611851 is a reply to message #435002] Mon, 10 November 2008 10:14 Go to previous message
Eclipse UserFriend
Neil,

Thanks for you answer. Just to clarify my scenario, I use a shared
persistence.xml, and to facilitate, instead of listing each entity class
in the XML, I refer directly to the JAR. That's a lot practical since I
don't need to know all the entities that are being packaged.

I think that kind of support by Dali would be helpful to JEE developers.

See ya!
Previous Topic:session bean generation?
Next Topic:"This mapped class is not specified in persistence unit" and related issues
Goto Forum:
  


Current Time: Tue Jul 22 19:28:17 EDT 2025

Powered by FUDForum. Page generated in 0.03141 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top