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 17:59 Go to next message
Felipe Kamakura is currently offline Felipe KamakuraFriend
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 18:06 Go to previous messageGo to next message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 470
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 15:14 Go to previous message
Felipe Kamakura is currently offline Felipe KamakuraFriend
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 18:06 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 470
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 15:14 Go to previous message
Felipe Kamakura is currently offline Felipe KamakuraFriend
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: Fri Dec 19 08:05:07 GMT 2014

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

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