8.12.5 @Basic
- Organization of this subsection
(1) Description
This annotation indicates the type of mapping to the simplest database column.
This annotation can be applied to the properties or instance variables of the following persistence types:
-
Java primitive type
-
Primitive type wrapper class
-
java.lang.String
-
java.math.BigInteger
-
java.math.BigDecimal
-
java.util.Date
-
java.util.Calendar
-
java.sql.Date
-
java.sql.Time
-
java.sql.Timestamp
-
byte[]
-
Byte[]
-
char[]
-
Character[]
-
enums
-
User-defined serialize type
The applicable targets are method and field.
(2) Element
The following table lists the elements of @Basic:
Element name |
Optional/Required |
Element description |
---|---|---|
Optional |
This element specifies the specification value of the fetch strategy. |
|
optional |
Optional |
This element specifies whether or not a null value can be used in the field or property. Note that Cosminexus JPA provider does not support this attribute. |
The details of attributes that are supported with Cosminexus JPA provider are as follows:
(a) fetch element
- Type
-
FetchType
- Description
-
This element specifies the specification value of the fetch strategy.
FetchType.EAGER or FetchType.LAZY can be specified.
Furthermore, the fetch attribute is ignored in Cosminexus JPA provider CJPA provider, and the default FetchType.EAGER is usually applied. For details on the fetch attribute, see 9.4.5 Synchronization with the database.
- Default value
-
FetchType.EAGER