Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
update README.md
  • Loading branch information
juergen-plohn committed Aug 25, 2023
1 parent ea60751 commit 35d89fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion persistence-utils-product/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ Axon Ivy's JPA Persistence Lib utility helps you accelerate process automation i
*Incompatibilities*
- Datatype of **AuditableEntity**s **Header** attributes for create/update and delete date where changed to *Instant*
- Attribute **expiryDate** of **ToggleableEntity** has been renamed to **expiry** and its datatype changed to *Instant*
- Datatype of **ToggleableEntity**s **enabled** has been changed to boolean
- Attribute **ToggleableEntity**s **isEnabled** has been renamed to **enabled** and its datatype changed to *boolean*

*Recommendations*
- rename the expiry column to **expiry** unless you have customized the column names anyways. e.g. ALTER TABLE **yourtable** RENAME COLUMN **expiryDate** TO **expiry**.
- rename the isEnabled column to **enabled** unless you have customized the column names anyways. e.g. ALTER TABLE **yourtable** RENAME COLUMN **isEnabled** TO **enabled**.
- Make sure there are no *NULL* values for the **enabled** column in your database. The column was defined as not nullable, so only manual changes in the database should have lead to *NULL* values
- use *get/set...AsDate* or *get/set...AsLocalDateTime* methods to get converted datatypes of create/update/delete/expiry *Instant*s

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ public void setExpiry(Instant expiryDate) {
* @return true if expiryDate is set and is before
*/
public boolean isExpired() {
Instant now = Instant.now();
return expiry != null && expiry.compareTo(now) < 0;
return expiry != null && expiry.isBefore(Instant.now(null));
}

/**
Expand Down

0 comments on commit 35d89fa

Please sign in to comment.