jakartaee / persistence

https://jakartaee.github.io/persistence/
Other
191 stars 55 forks source link

deprecate support for Calendar, Date, Time, Timestamp #402

Closed gavinking closed 12 months ago

gavinking commented 1 year ago

The classes java.util.Calendar, java.util.Date, java.sql.Date, java.sql.Time, java.sql.Timestamp are bad and nobody should ever use them.

We should make this explicit by:

  1. stating that use of these types in entity classes is deprecated, and
  2. deprecating methods like Query.setParameter() which accept them.

We might even be able to deprecate TemporalType.

lukasj commented 1 year ago

the real meaning here is not to deprecate support for.. but to deprecate usage of... and promote usage of java.time API instead, right?

gavinking commented 1 year ago

the real meaning here is not to deprecate support for.. but to deprecate usage of... and promote usage of java.time API instead, right?

Well the idea is we want to tell users of JPA not to use these things in new code, and to use the java.time types instead.

Of course persistence providers will still be required to support them, and I'm not suggesting any sort of plan to remove that support.