@Retention(value=RUNTIME) @Target(value=FIELD) public @interface DbArray
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.
// 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<>();
| Modifier and Type | Optional Element and Description |
|---|---|
int |
length
For VARCHAR storage specify the column length (defaults to 1000).
|
public abstract int length
Copyright © 2016. All rights reserved.