question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature to allow history entity creation using Copy-Paste

See original GitHub issue

Hi!

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:closed
  • Created 6 years ago
  • Comments:23 (23 by maintainers)

github_iconTop GitHub Comments

1reaction
slavb18commented, Apr 3, 2017

Another possible solution , and much simpler, is to allow one-moment entity copy - and paste. And property copy-and paste.

0reactions
slavb18commented, Apr 6, 2017

Thanks for your attention, then I close this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customizing the migrations history table - EF6
Migrations history table is a table used by Code First Migrations to store details about migrations applied to the database. By default the...
Read more >
Copy and Paste Sketches and Components in Fusion 360
In this tutorial, I'll show you how to copy sketches within a sketch, to other sketches, and to other Fusion 360 files.
Read more >
Copy and Paste Sketches, Bodies, and Components in ...
Learn how to copy sketches within a sketch, to other sketches, and to other Fusion 360 files. We'll also look at problems users...
Read more >
Java Framework to maintain entity history automatically
I am working on a project where I need to create history of particular table automatically. I have used @ ...
Read more >
Copy and paste using the clipboard—ArcGIS Pro
Cut Cut , Copy Copy , and Paste Paste use the clipboard to copy selected features and attributes values to the same layer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found