Skip to content

Commit

Permalink
Fix for #3229
Browse files Browse the repository at this point in the history
  • Loading branch information
gliljas committed Oct 24, 2024
1 parent 553a951 commit dfa4734
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/NHibernate/Id/Enhanced/OptimizerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,10 @@ public override object Generate(IAccessCallback callback)
generationState.LastSourceValue = callback.GetNextValue();
generationState.Value = generationState.LastSourceValue;
// handle cases where initial-value is less than one (hsqldb for instance).
while (generationState.Value < 1)
generationState.Value++;
if (generationState.Value < 1)
{
generationState.Value = 1;
}
}

return Make(generationState.Value++);
Expand Down

0 comments on commit dfa4734

Please sign in to comment.