[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Dynamic Schemas
|
There are pre/postExecuteQuery events on the SessionEventManager (these are
session events, not descriptor events).
You might be better off handling this complexity in your application/model
instead of trying to automate it. i.e. have several different classes or
subclasses mapped to each schema, or several different sessions/persistence
contexts, and query the desired one directly.
EclipseLink does have some features, such as TABLE_PER_CLASS inheritance,
and VariableOneToOne mappings which may be of some use.
bryans wrote:
>
> Rather than start digging without knowing where to make changes, i figured
> i'd ask my question to the developers who created the framework.
>
> I have an entity that's mapped to a table. This table actually exists in
> multiple database schemas, they are identical in every way. We use a
> look-up table to determine which schema to use. The look-up value is an
> attribute of the entity.
>
> I need to be able to put in some kind of logic into an entity SQL
> generating stack to change the schema based on that look-up. I know the
> look-up logic, but my question is where to manipulate the SQL generation.
>
> I thought about manipulating the Descriptor's qualifier prior to SQL
> generation, however i found some thing somewhere that said once the
> Descriptor is created for an entity it shouldn't be modified (i assume
> threading issues).
>
> So my next thought was to build in some entity listeners to manipulate the
> SQL during the call stack. I haven't done that yet because: there's no
> pre-read query listener. There are pre/post handlers for create, update,
> and delete, but not read...
>
> Suggestions on how i should go about my task? (And why isn't there a
> pre-load listener?)
>
> -B
>
-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://old.nabble.com/Dynamic-Schemas-tp26610882p26694861.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.