Feature to allow history entity creation using Copy-Paste
See original GitHub issueHi!
EclipseLink provides support for history tables, however, it lacks support for auto history table creation. https://wiki.eclipse.org/EclipseLink/Examples/JPA/History
Automatic table creation and extending could be achieved by special “History Entity” e.g.
Base entity
@Entity
public class Person {
@Id
private Long personId;
private String firstName;
private String lastName;
..
}
History entity contains same fields, except @Id field (personId in example) should be @Basic, becouse it will contain many records with same id
And additionally it should contain fields (could be modelled as usual)
@Entity
public class PersonHist {
@Id
private Long histId;
// Add here the extra fields/columns that should exist for the
// history table.
private Date rowStartTime;
private Date rowEndTime;
..
}
My proposal is to create “mirror”, or “history” entity, based on real entity, which will replicate all fields from the base entity, except replacing @Id with @Basic (or allows attribute override) And allows to specify additional fields, like @Id private Long histId; private Date rowStartTime; private Date rowEndTime;
Base idea is to allow modeling special “mirror” entities, with possibility to add / override fields from base entity
Issue Analytics
- State:
- Created 6 years ago
- Comments:23 (23 by maintainers)
Top GitHub Comments
Another possible solution , and much simpler, is to allow one-moment entity copy - and paste. And property copy-and paste.
Thanks for your attention, then I close this issue