I\'m having an Entity which has a primary key / id field like the following:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
I might be missing something obvious, but why not just define another Entity with the same @Table(name=".....") annotation, with the same fields, but make the id not generated? Then you can use that Entity for the code that copies data from the old DB to the new, and the one with the generated Id can be used for normal creates that require id generation.
I can't tell you if it works with EclipseLink, but we're using Hibernate here and it doesn't seem to mind it.