Module is.codion.framework.db
Package is.codion.framework.db.exception
Class EntityModifiedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
is.codion.common.db.exception.DatabaseException
is.codion.framework.db.exception.UpdateEntityException
is.codion.framework.db.exception.EntityModifiedException
- All Implemented Interfaces:
Serializable
An exception indicating that an entity, being updated, has been modified or deleted since it was loaded.
The message, describing the modification, is put together when read, in the language of the reader,
see DatabaseException.getMessage() and message(Locale).
- See Also:
-
Field Summary
Fields inherited from class is.codion.common.db.exception.DatabaseException
SQL_STATE_NO_DATA -
Constructor Summary
ConstructorsConstructorDescriptionEntityModifiedException(Entity entity, @Nullable Entity modified, Collection<Column<?>> columns) Instantiates a new EntityModifiedException -
Method Summary
Modifier and TypeMethodDescriptionCollection<Column<?>> columns()entity()Returns the message in the given locale, for an exception based on an error type, otherwise the message this exception was constructed with, which is not affected by the locale.modified()Methods inherited from class is.codion.common.db.exception.DatabaseException
detail, errorCode, errorType, getMessage, setStackTrace, sqlStateMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, toString
-
Constructor Details
-
EntityModifiedException
public EntityModifiedException(Entity entity, @Nullable Entity modified, Collection<Column<?>> columns) Instantiates a new EntityModifiedException- Parameters:
entity- the entity being updatedmodified- the current (modified) version of the entity, null if it has been deletedcolumns- the modified columns, an empty collection in case the entity has been deleted
-
-
Method Details
-
entity
- Returns:
- the entity being updated
-
modified
- Returns:
- the current (modified) version of the entity, an empty Optional if it has been deleted
-
columns
- Returns:
- the modified columns, or an empty collection in case the entity has been deleted
-
message
Description copied from class:DatabaseExceptionReturns the message in the given locale, for an exception based on an error type, otherwise the message this exception was constructed with, which is not affected by the locale. Useful where the default locale is not the one of the reader, a web server serving users of different languages for example.- Overrides:
messagein classDatabaseException- Parameters:
locale- the locale- Returns:
- the exception message in the given locale
-