There's no way to do this in JPA and I am not aware of any providers
that provide this functionality either. Generally data is broken into
multiple tables to provide more efficient querying but this approach
would mean that the persistence provider would still need to join across
all tables to retrieve results.
You may want to have multiple Entities as well that way the application
can make more decisions and produce more efficient queries.
--Gordon
Leonard Sitongia wrote:
> Sorry if this is the wrong list for this subject. Please let me know
> if you have a better idea.
>
> I have large tables of data organized in time. I'm thinking that I'll
> break it up into separate tables by year, to keep the table size down
> to 300,000-ish rows.
>
> Is there a way to define the table to map a class to at runtime, a
> dynamic @Table(name=runtime-expression)? The schema in the tables
> will be same of course, only the name changes.
>
> Thanks!
>