users@glassfish.java.net

Re: Entity bean composed from 2 different database ?

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Thu, 11 Mar 2010 18:56:13 -0800

A persistence unit can not span multiple data source so you might not be
able to do this directly. If your underlying database supports, you
might want to create a view that represents data from both databases.
Then you can map your entities to it and execute a query.


On 3/11/2010 11:01 AM, glassfish_at_javadesktop.org wrote:
> Hi All,
>
> Is it possible to create an entity bean (or a query in an entity) from 2 different database (or different entity bean / different ejb) ? or for more complicated from different server machine ?
>
> Example in sql:
>
> SELECT c.*, o*
> FROM db1.customer c
> INNER JOIN db2.sales_order o
> ON o.customerid = c.customerid
>
> thanks
> bedjo
> [Message sent by forum member 'bedjo' (totnamreh_at_hotmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=391331
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>