Table prefix

View: New views
3 Messages — Rating Filter:   Alert me  

Table prefix

by Chr|stian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there a way to prefix the tables during runtime?
For instance, the table name "categories" is sometimes called
"zen_categories", or any other variation like "mca_categories".


Now I've seen something in OpenJPA that is supposedly able to handle
this (DBDictionary, getValidTableName() ), but is there anything in
EclipseLink that can handle such a use case? (Edgy as it may be).

--
Regards
Christian Michelsen
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Table prefix

by saasira :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It would be worthwhile to have eclipselink support both prefix and suffix to the table names; I believe this would help in  implementing scalable database architectures where some kind of monthly rotation algorithm can be employed so that queries are always executed on the table with smaller and relevant data,hence return results faster.
 
 
On Thu, Jul 9, 2009 at 2:35 AM, Christian August Michelsen <chris-m@...> wrote:
Is there a way to prefix the tables during runtime?
For instance, the table name "categories" is sometimes called "zen_categories", or any other variation like "mca_categories".


Now I've seen something in OpenJPA that is supposedly able to handle this (DBDictionary, getValidTableName() ), but is there anything in EclipseLink that can handle such a use case? (Edgy as it may be).

--
Regards
Christian Michelsen
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Table prefix

by James Sutherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can set a table-qualifier (schema), that can apply to all descriptors in the session.  Not sure where you would want the prefix, I assume this is for default table generation?  You can specify the @Table name directly on each Entity.  You could also use a SessionCustomizer to iterate over the ClassDescriptors and add a prefix to the tables.


saasira wrote:
It would be worthwhile to have eclipselink support both prefix and suffix to
the table names; I believe this would help in  implementing scalable
database architectures where some kind of monthly rotation algorithm can be
employed so that queries are always executed on the table with smaller and
relevant data,hence return results faster.


On Thu, Jul 9, 2009 at 2:35 AM, Christian August Michelsen
<chris-m@c2i.net>wrote:

> Is there a way to prefix the tables during runtime?
> For instance, the table name "categories" is sometimes called
> "zen_categories", or any other variation like "mca_categories".
>
>
> Now I've seen something in OpenJPA that is supposedly able to handle this
> (DBDictionary, getValidTableName() ), but is there anything in EclipseLink
> that can handle such a use case? (Edgy as it may be).
>
> --
> Regards
> Christian Michelsen