Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » extending a bundle with entities from an other bundle?(orm.xml, persitence in both bundles?? )
icon4.gif  extending a bundle with entities from an other bundle? [message #695160] Mon, 11 July 2011 06:57 Go to next message
Sergei Jochim is currently offline Sergei Jochim
Messages: 6
Registered: July 2011
Junior Member
Hi .. !

I have two projects p1 and p2. p2 is an enxtension for p1.

imageshack.us/photo/my-images/687/screenproblem.png/


p1 is a server. Now i want to make p2 to a server extension. p2 has a dependency to p1.

I wrote a new entity in the extension.


My Problem is:
i wrote a new orm.xml in p2, but when I start p1 + p2, it only finds the orm.xml from p1 but not from p2.. Maybe I need an extra persitence-unit/ provider? How can I extend the server with new entities in other bundles(the server doesn't know which one)?




p2 orm.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="// java.sun.com/xml/ns/persistence/orm" xmlns:xsi="// www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" java.sun.com/xml/ns/persistence/orm orm_1_0.xsd" version="1.0">
	<entity class="de..server.domain.ProductGroup" />
</entity-mappings>


p1 orm.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns=" //java.sun.com/xml/ns/persistence/orm" xmlns:xsi="/ /www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="// java.sun.com/xml/ns/persistence/orm orm_1_0.xsd" version="1.0">
	<entity class="de..domain.Person" />
	<entity class="de..domain.Team" />
</entity-mappings>


and the persitence.xml is only available in p1:

<?xml version="1.0" encoding="windows-1252" ?>
<persistence xmlns:xsi=":/ /www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation=":/ /java.sun.com/xml/ns/persistence :/ /java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
	version="1.0" xmlns=": //java.sun.com/xml/ns/persistence">



	<persistence-unit name="persitor*" transaction-type="RESOURCE_LOCAL">
		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
		<properties>
			<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
			<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/*****"/>
			
	    	  <property name="javax.persistence.jdbc.user" value="****"/>
			<property name="javax.persistence.jdbc.password" value="***"/>
 
 
			<property name="eclipselink.jdbc.read-connections.min" value="1" />
			<property name="eclipselink.jdbc.write-connections.min" value="1" />
			<property name="eclipselink.jdbc.batch-writing" value="JDBC" />
 
			<!-- Logging -->
			<property name="eclipselink.logging.level" value="FINE" />
			<property name="eclipselink.logging.timestamp" value="false" />
			<property name="eclipselink.logging.session" value="false" />
			<property name="eclipselink.logging.thread" value="false" />
			
	</persistence-unit>
	
</persistence>




I had to remove all "http" from this post, because it's my first post !!!

[Updated on: Mon, 11 July 2011 13:37]

Report message to a moderator

Re: extending a bundle with entities from an other bundle? [message #698495 is a reply to message #695160] Tue, 19 July 2011 15:01 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I don't think this is possible. You need to either include the extensions in the parent persistence unit, or create a new persistence unit in the child.


James : Wiki : Book : Blog : Twitter
(no subject) [message #698505 is a reply to message #695160] Tue, 19 July 2011 15:01 Go to previous messageGo to next message
James is currently offline James
Messages: 272
Registered: July 2009
Senior Member
I don't think this is possible. You need to either include the extensions in the parent persistence unit, or create a new persistence unit in the child.

--
James : http://wiki.eclipse.org/EclipseLink : http://en.wikibooks.org/wiki/Java_Persistence : http://java-persistence-performance.blogspot.com/
Re: extending a bundle with entities from an other bundle? [message #698786 is a reply to message #695160] Wed, 20 July 2011 08:22 Go to previous message
Sergei Jochim is currently offline Sergei Jochim
Messages: 6
Registered: July 2011
Junior Member
This was my fear. Rolling Eyes

I found a similar open BUG in Gemini Project.

bugs.eclipse.org/bugs/show_bug.cgi?id=337425
Previous Topic:how to automatically refresh a cached namedquery after object insertion/deletion ?
Next Topic:(no subject)
Goto Forum:
  


Current Time: Sat Sep 20 22:08:01 GMT 2014

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

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