Specify a collection property that will be stored into a DB ARRAY type.
If the target database does not support ARRAY type (so not Postgres) then the collection will be stored in JSON format into a VARCHAR column.
Example:
// Store as ARRAY of UUID on Postgres
@DbArray
List<UUID> uids = new ArrayList<>();
// Store as ARRAY on Postgres
@DbArray
List<String> phoneNumbers = new ArrayList<>();
// Store as ARRAY of INTEGER on Postgres
@DbArray
List<Long> someLongs = new ArrayList<>();
-
Optional Element Summary
Optional Elements
-
Element Details
-
name
String nameThe name of the column (Optional).- Default:
- ""
-
length
int lengthFor VARCHAR storage specify the column length (defaults to 1000).- Default:
- 0
-