Merge pull request #6611 from eugenp/FIX-onBeforeConvert

BAEL-1961: Fixed UserModelListener.onBeforeConvert()
This commit is contained in:
Eric Martin 2019-03-29 20:56:17 -05:00 committed by GitHub
commit 32ae967b76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -21,7 +21,9 @@ public class UserModelListener extends AbstractMongoEventListener<User> {
@Override
public void onBeforeConvert(BeforeConvertEvent<User> event) {
event.getSource().setId(sequenceGenerator.generateSequence(User.SEQUENCE_NAME));
if (event.getSource().getId() < 1) {
event.getSource().setId(sequenceGenerator.generateSequence(User.SEQUENCE_NAME));
}
}