Basic
Target: METHOD, FIELD
- Implemented Interfaces:
Annotation
The simplest type of mapping of a persistent field or property to a single database column.
The Basic annotation may be applied to a property or instance variable whose type is any one of the following:
- a Java primitive type, or wrapper of a primitive type,
- String,
- java.math.BigInteger or java.math.BigDecimal,
- java.time.LocalDate, java.time.LocalTime, java.time.LocalDateTime, java.time.OffsetTime, java.time.OffsetDateTime, java.time.Instant, or java.time.Year
- java.util.Date or java.util.Calendar,
java.sql.Date,java.sql.Time, orjava.sql.Timestamp,byte[]orByte[],char[]orCharacter[],- a Java
enumtype, or - any other plain type.
The use of the Basic annotation is optional for persistent fields and properties of these types. If the Basic annotation is not specified for such a field or property, the default values of the Basic annotation apply.
The database column mapped by the persistent field or property may be specified using the Column annotation.
Example 1:
{@snippet :- Since:
- JPA 1.0