Skip to content

Remove deprecated @Temporal annotations from User entity date fields #282

Description

@devondragon

Problem

Hibernate logs deprecation warnings on startup for applications using SpringUserFramework:

HHH90000033: Encountered use of deprecated annotation [jakarta.persistence.Temporal] on:
- com.devondragon.springuserframework.user.persistence.model.User.lastActivityDate
- com.devondragon.springuserframework.user.persistence.model.User.lockedDate  
- com.devondragon.springuserframework.user.persistence.model.User.registrationDate

The @Temporal annotation is unnecessary for Java 8+ date/time types (LocalDate, LocalDateTime, Instant, etc.) — Hibernate handles them natively. If these fields use java.util.Date, they should be migrated to modern types.

Fix

  1. Check the types of lastActivityDate, lockedDate, and registrationDate on the User entity
  2. If they use java.util.Date → migrate to java.time.LocalDateTime (or appropriate type) and remove @Temporal
  3. If they already use Java 8+ types → simply remove the @Temporal annotation
  4. Update any related code that interacts with these fields

Priority

Low — deprecation cleanup, but will eventually break in a future Hibernate version.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions