You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mauro2java2011 <ma...@gmail.com> on 2014/02/24 12:45:56 UTC

it is possible put persistence.xml into a jar indipendent that use into a web application?

Hi all. 
I ask for know if it is possible the following  configuration: 

I write a web app like a war or ear .
i would write also a swing client remote that call the ejb and create new
instance of entity . So for resolve the problem of entity eahnched i would
create the entity class eahnched  into a lib jar that i import into the
web/ear application and into the swing remote client. 

I Can put a file persistence.xml into another jar that i import into the
web-inf/lib of web application.???? Not into the jar that contains the
entityes.

So i can reuse the same entityes compilated for many other db.
The structure of jar it is: 
Meta-inf/persistence.xml 

2) into the jar of eanched entitys i can not insert a persistence.xml or it
is mandatary to add and next use the other persistence.xml from the other
.jar reservafed for configure at what dbi have to connect ? 

Tank you in advance .
mauro
U



--
View this message in context: http://openejb.979440.n4.nabble.com/it-is-possible-put-persistence-xml-into-a-jar-indipendent-that-use-into-a-web-application-tp4667958.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: it is possible put persistence.xml into a jar indipendent that use into a web application?

Posted by mauro2java2011 <ma...@gmail.com>.
A example of use of <jar-file> elements ?
Il giorno 24/feb/2014 13.03, "Anthony Fryer [via OpenEJB]" <
ml-node+s979440n4667959h4@n4.nabble.com> ha scritto:

> You can create a persistence.xml in your WEB-INF folder and reference jar
> files in your WEB-INF/lib using the <jar-files> element.  I normally put
> jar files into WEB-INF/lib and put persistence.xml in /META-INF of those
> jar files.
>
> You could create a remote ejb interface and pass your entity classes as
> method parameters if you wanted to since they are serializable.  In the ejb
> method you could do an em.merge(...) to attach the object to the entity
> manager.
>
> Anthony
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/it-is-possible-put-persistence-xml-into-a-jar-indipendent-that-use-into-a-web-application-tp4667958p4667959.html
>  To unsubscribe from it is possible put persistence.xml into a jar
> indipendent that use into a web application?, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4667958&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2Njc5NTh8LTExMTcxODc2MjU=>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://openejb.979440.n4.nabble.com/it-is-possible-put-persistence-xml-into-a-jar-indipendent-that-use-into-a-web-application-tp4667958p4667960.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: it is possible put persistence.xml into a jar indipendent that use into a web application?

Posted by Anthony Fryer <ap...@hotmail.com>.
You can create a persistence.xml in your WEB-INF folder and reference jar
files in your WEB-INF/lib using the <jar-files> element.  I normally put jar
files into WEB-INF/lib and put persistence.xml in /META-INF of those jar
files.

You could create a remote ejb interface and pass your entity classes as
method parameters if you wanted to since they are serializable.  In the ejb
method you could do an em.merge(...) to attach the object to the entity
manager.

Anthony



--
View this message in context: http://openejb.979440.n4.nabble.com/it-is-possible-put-persistence-xml-into-a-jar-indipendent-that-use-into-a-web-application-tp4667958p4667959.html
Sent from the OpenEJB User mailing list archive at Nabble.com.