Tables In Ejb3
I am working with EJB3 and I have the next doubt:
I have in my dbase 3 tables with the same structure (Mov2005, Mov2006 and Mov2007) and the records be inserted in these depending of the year in the date of the movement.
they all have the same structure, the ideal thing would be create the only entity that administers the information, but here my great worry comes and is how I say to to the EntityManager that it should insert in certain table depending the year of the movement?
I have investigated and the only thing that I found is to create an entity for every table and to use CreateQuery to create the Dynamical sql, but this would imply that every year it is necessary to modify the application to create the entity. One thought of leaving the whole movement in the same table, but the volume of records per year is high and starts getting lost time of response.
What is your database? sql? mysql? the thing that you want to do calls:"Partinioning"that is to say, to save a table (that is waited is very big) partitioned in several tables from criteria
It is practical commonly when one works with big volume and motors such as: oracle and PostgreSQL have this functionality and are transparent to the development of the application. Notice if you solve for this side.