webtier@glassfish.java.net

changing entity schema at runtime

From: <webtier_at_javadesktop.org>
Date: Mon, 28 Sep 2009 06:01:42 PDT

Hi!

I'm writting a multilanguage application. Each language is supposed to have its own database schema with tables. Depending on the language choosen at runtime, application web tier would call EJB methods providing a database schema for entity manager queries.

I could do this be forming certain queries in native SQL and replacing the 'schema' part of the query string. This is either not nice nor convienient.

Is it possible to set the entity @Table(schema=...) definition at runtime? Or maybe there's some other way?
[Message sent by forum member 'dziku' (kpach_at_poczta.onet.pl)]

http://forums.java.net/jive/thread.jspa?messageID=366045