Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Shared persistence.xml
Shared persistence.xml [message #435001] Mon, 03 November 2008 12:59 Go to next message
Felipe Kamakura is currently offline Felipe Kamakura
Messages: 4
Registered: July 2009
Junior Member
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
Neil Hauge is currently offline Neil Hauge
Messages: 467
Registered: July 2009
Senior Member
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
Felipe Kamakura is currently offline Felipe Kamakura
Messages: 4
Registered: July 2009
Junior Member
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
Neil Hauge is currently offline Neil Hauge
Messages: 467
Registered: July 2009
Senior Member
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
Felipe Kamakura is currently offline Felipe Kamakura
Messages: 4
Registered: July 2009
Junior Member
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:Shared persistence.xml
Next Topic:"This mapped class is not specified in persistence unit" and related issues
Goto Forum:
  


Current Time: Wed Jul 30 07:17:23 EDT 2014

Powered by FUDForum. Page generated in 0.04282 seconds