Using Jooq 3.10 and Postgresql 10 - Not using the code generator
I'm trying to improve some code that uses primitive arrays, specifically
String[ ] . As everyone knows arrays can be clunky to work with, Lists are
much preferred but I can't figure out how to bind a PostgreSQL array field
to a List<T>
..
..
public final TableField<EventRecord, String[]> TAGS = createField("tags",
SQLDataType.VARCHAR.getArrayDataType(), this);
..
..
and in my pojo I have
private String[] tags;
..
...
....
@Column(name="tags")
public void setTags(String[] tags) {
this.tags = tags;
}
I want to change the type of tags in the pojo from String[] to
ArrayList<String>
How would I get JOOQ to map the postgresql array into a collection?
Is there a createField equivalent that has built in conversion from arrays
to collections or must I write a custom converter?
Seems like a typical use case but alas searches of docs, the group, and
stackoverflow have come up empty.
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/b6ec9f48-4b15-4adb-8237-0415a2933282%40googlegroups.com.