Hi Rick,
Thanks for reporting this. This is a documentation bug. The statement
should really read:
create.insertInto(AUTHOR, AUTHOR.ID, AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
.values(S_AUTHOR_ID.nextval(), val("William"), val("Shakespeare"));
Where .val() is static-imported from org.jooq.impl.DSL. Most of jOOQ's API
is overloaded for convenience, such that you can omit creating a bind value
explicitly, if applicable.
I have registered #2714 to fix this.
https://github.com/jOOQ/jOOQ/issues/2714
A workaround exists with Arrays.asList:
create.insertInto(AUTHOR, AUTHOR.ID, AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
.values(Arrays.asList(S_AUTHOR_ID.nextval(), "William", "Shakespeare"));
2013/8/27 <[email protected]>
> [...]
> A workaround exists with Arrays.asList:
>
> create.insertInto(AUTHOR, AUTHOR.ID, AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
> .values(Arrays.asList(S_AUTHOR_ID.nextval(), "William", "Shakespeare"));
>
> Yes, Collection<?> is often declared in the API when generics cannot be
enforced. In this case, <?> is chosen over <? extends Field<?>> to also
allow for plain bind values.
Usually, it is better to explicitly create bind values for improved
typesafety
Hope this helps,
Lukas
--
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].
For more options, visit https://groups.google.com/groups/opt_out.