Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discourage Character[] and Byte[] #550

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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