Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #238

Re: Java Toplink Essentia

From "Martin Gregorie" <martin.gregorie@THRWHITE.remove-dii-this>
Subject Re: Java Toplink Essentia
Message-ID <ga9fj1$t22$2@localhost.localdomain> (permalink)
Newsgroups comp.lang.java.databases
References <ebbd5a78-c149-4cc3-9251-7214d34ca042@m73g2000hsh.googlegroups.com>
Date 2011-04-27 15:22 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
On Wed, 10 Sep 2008 01:23:48 -0700, nicola wrote:

> In my db there are some tables like
> 
> TABLE1_2006 (ID, CODE, VOLUME)
> TABLE2_2007 (ID, CODE, VOLUME)
> TABLE3_2008 (ID, CODE, VOLUME)
> 
> They are equal but have diffferent name. In fact these tables are
> created
> every year (as you can see).
> In this sense they use the same entity
> 
> public class MyEntity implements Serializable {
>     private static final long serialVersionUID = 1L; @Id
>     @Column(name = "ID", nullable = false) private Integer id;
>     @Column(name = "CODE")
>     private String code;
>     @Column(name = "VOUME")
>     private String volume;
> 
> ...
> ...
> ...
> }
> 
> I need to obtain different list of entities relative to all tables in
> the same database;
> can I change table name of my entity at runtime ?
> 
> 
Declare a view  over all the tables and enquire on that.

But, why on earth use multiple tables? They don't do anything that a 
single table with a YEAR column couldn't do while managing to make at 
least one task more difficult as you've just demonstrated.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Java Toplink Essential - "nicola" <nicola@THRWHITE.remove-dii-this> - 2011-04-27 15:22 +0000
  Re: Java Toplink Essentia "Martin Gregorie" <martin.gregorie@THRWHITE.remove-dii-this> - 2011-04-27 15:22 +0000
    Re: Java Toplink Essentia "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:22 +0000
      Re: Java Toplink Essentia "Arved Sandstrom" <arved.sandstrom@THRWHITE.remove-dii-this> - 2011-04-27 15:22 +0000

csiph-web