The reason that forRevisionsOfEntity do not impose a positive number check unlike the other exposed find methods is because the user isn't asked to provide a revision number for that query signature. The revision number sequence Envers uses is designed to start at 1 and increment by 1 for each revision generated in the system, hence the reason the data check exists where applicable for user input arguments. A more appropriate solution would be to leverage the fact you can supply Envers with a custom annotated @RevisionEntity entity where you could add a specify a flag to indicate whether the revision was a migration revision or not. This avoids tainting the revision number with some magic value as well as potentially exposing a forward compatibility concern with future changes. |