Skip to content

Commit

Permalink
improved OptimisticLockException
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille committed Dec 23, 2023
1 parent 1b6237a commit 5481a5b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.entity.id;

import io.github.mmm.base.exception.ApplicationException;
import io.github.mmm.entity.Entity;

/**
Expand All @@ -13,7 +14,7 @@
* This will prevent that two users that want to save changes to the same {@link Entity} concurrently may override each
* others changes.
*/
public class OptimisicLockException extends RuntimeException {
public class OptimisicLockException extends ApplicationException {

/**
* The constructor.
Expand All @@ -27,4 +28,10 @@ public OptimisicLockException(Id<?> id, String entityName) {
+ "' because the revision '" + id.getRevisionAsString() + "' is outdated!");
}

@Override
public String getCode() {

return "DB-LOCK";
}

}

0 comments on commit 5481a5b

Please sign in to comment.