Class EmptyLastActivityException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.goldenleaf.shop.exception.EmptyLastActivityException
- All Implemented Interfaces:
Serializable
Checked exception thrown when an attempt is made to create or persist a user
(customer, admin, etc.) without specifying the date of the last activity.
The lastActivity field in the base User
entity represents the date/time of the most recent user interaction
(login, order placement, profile update, etc.).
Although it can be automatically set to the current date on first login,
certain business rules or data-import scenarios require an explicit value.
Typical scenarios that trigger this exception:
- Creating a
User(or subclass) withnulllastActivity when the application policy forbids it - Importing/migrating historical user data where the last activity date is mandatory
- Validation in administrative tools that enforce complete audit information
- Custom user creation workflows that require an explicit initial activity date
This is a checked exception, forcing the caller to handle the missing last-activity date explicitly. It is intended for expected, recoverable validation situations rather than programming errors.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEmptyLastActivityException(String message) Constructs a new empty-last-activity exception with the specified detail message.EmptyLastActivityException(String message, Throwable cause) Constructs a new empty-last-activity exception with the specified detail message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EmptyLastActivityException
Constructs a new empty-last-activity exception with the specified detail message.- Parameters:
message- the detail message (e.g. "User last activity date cannot be null") Saved for later retrieval byThrowable.getMessage()
-
EmptyLastActivityException
Constructs a new empty-last-activity exception with the specified detail message and cause.Useful when wrapping a lower-level exception (e.g., constraint violation, data parsing error, or migration tool failure).
- Parameters:
message- the detail messagecause- the root cause of this exception- Since:
- 1.2
-