Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: JPA OneToOne annotation across two different jdbc drivers Date: Tue, 22 Nov 2011 07:16:00 -0800 (PST) Organization: http://groups.google.com Lines: 19 Message-ID: <26839074.317.1321974960424.JavaMail.geo-discussion-forums@prdy11> References: Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1321974963 4883 127.0.0.1 (22 Nov 2011 15:16:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 22 Nov 2011 15:16:03 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10173 Jeffrey H. Coffield wrote: > We have data in two different databases types (MySQL and OpenVMS). Both > have JDBC drivers. Does someone have an example of using the JPA > annotations to connect across two different persistence units? What, precisely, do you mean by "connect across two different persistence units"? You can connect to two persistence units by defining two 'EntityManager' instances, one for each PU. Is that what you're asking for? Which annotations did you have in mind? Certainly '@Entity' and '@EntityManager' will work with multiple persistence units. Of course, annotations like '@OneToMany' will not, AFAIK, since they map to foreign-key relationships in the DBMS. How about giving us a /precise/ explanation of what you wish to accomplish? Programming is an art of precision. "Using annotations to connect across two persistence units" is so vague as to be meaningless. -- Lew