Extending existing roo entities
Hi,
my second post in a day, apologies for spam. Hopefully somebody will know ...
I have a big roo project in production for quite a long time.
Now I am facing problem with tables becoming huge. Since I do not need to keep data older than 3 months, I am thinking about moving data from "active" tables into archive tables in some batch nightly process.
I use
Code:
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
as id in my entities.
Now, the question is: what is the best way to create the copies of the entities which differ only at Id, since IDs need to be the same as in "active" tables, I can't use JPA annotation, but set ids manually.
By "the best", I mean:
- minor to no change in existing entities,
- little repetition (avoiding copy paste) in archive entities.
- no change in existing db tables.
Thanks in advance,
Milan
Thanks