Skip to content

Commit

Permalink
discourage Character[] and Byte[]
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Dec 5, 2023
1 parent 95a9ee1 commit 63d381b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions api/src/main/java/jakarta/persistence/Basic.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
* protected String getName() { return name; }
* }
*
* <p>The use of {@link java.util.Date}, {@link java.util.Calendar},
* {@code java.sql.Date}, {@code java.sql.Time}, {@code java.sql.Timestamp},
* {@code Character[]}, or {@code Byte[]} as the type of a basic attribute
* is now discouraged. Newly-written code should use the date/time types
* defined in the package {@code java.time}, or the primitive array types
* {@code char[]} and {@code byte[]}.
*
* @since 1.0
*/
@Target({METHOD, FIELD})
Expand Down
6 changes: 4 additions & 2 deletions spec/src/main/asciidoc/ch02-entities.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,10 @@ fully initialized for the type that it is mapped to.]
of `java.util.Calendar` or of `java.util.Date` and its subclasses in the
package `java.sql` is strongly discouraged. Newly-written programs should
use date/time types from the package `java.time`.]
`byte[]`, `Byte[]`, `char[]`, `Character[]`, `java.time.LocalDate`,
`java.time.LocalTime`, `java.time.LocalDateTime`,
`byte[]`, `Byte[]`, `char[]`, `Character[]`,footnote:[The use of `Byte[]`
or of `Character[]` is discouraged. Newly-written programs should use
`byte[]` or `char[]` instead.]
`java.time.LocalDate`, `java.time.LocalTime`, `java.time.LocalDateTime`,
`java.time.OffsetTime`, `java.time.OffsetDateTime`,
`java.time.Instant`, `java.time.Year`,
and user-defined types that implement the `Serializable` interface);
Expand Down

0 comments on commit 63d381b

Please sign in to comment.