Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pass Table reference to row() constructor in array or list #15008

Closed
lukaseder opened this issue May 3, 2023 · 2 comments
Closed

Cannot pass Table reference to row() constructor in array or list #15008

lukaseder opened this issue May 3, 2023 · 2 comments

Comments

@lukaseder
Copy link
Member

Passing a Table reference to a row() constructor that accepts a Collection<?> or SelectField<?>... results in this exception:

java.lang.IllegalArgumentException: Cannot interpret argument of type class org.jooq.test.postgres.generatedclasses.public_.tables.TLanguage as a Field: "public"."t_language"
	at org.jooq.impl.Tools.fieldExpected(Tools.java:1831)
	at org.jooq.impl.Tools.field(Tools.java:2079)
	at org.jooq.impl.Tools.field(Tools.java:2087)
	at org.jooq.impl.Tools.lambda$64(Tools.java:2108)
	at org.jooq.impl.Tools.map(Tools.java:2330)
	at org.jooq.impl.Tools.fieldsArray(Tools.java:2108)
	at org.jooq.impl.DSL.row(DSL.java:32721)
	at org.jooq.impl.DSL.row(DSL.java:33037)
	at org.jooq.impl.DSL.multisetAgg(DSL.java:27270)
	at org.jooq.test.all.testcases.MultisetTests.lambda$21(MultisetTests.java:475)
	at org.jooq.test.jOOQAbstractTest.withDSLContext(jOOQAbstractTest.java:2340)
	at org.jooq.test.jOOQAbstractTest.bindAndInlineWithDSLContexts(jOOQAbstractTest.java:2333)
	at org.jooq.test.BaseTest.bindAndInlineWithDSLContexts(BaseTest.java:2031)
	at org.jooq.test.all.testcases.MultisetTests.lambda$20(MultisetTests.java:446)
	at org.jooq.test.all.testcases.MultisetTests.lambda$538(MultisetTests.java:3456)
	at org.jooq.test.all.testcases.MultisetTests.lambda$541(MultisetTests.java:3474)
	at org.jooq.test.all.testcases.MultisetTests.testRecordLevelListenerResults(MultisetTests.java:3513)
	at org.jooq.test.all.testcases.MultisetTests.testRecordLevelListenerResults(MultisetTests.java:3501)
	at org.jooq.test.all.testcases.MultisetTests.testMultisetEmulations(MultisetTests.java:3474)
	at org.jooq.test.all.testcases.MultisetTests.testMultisetEmulations(MultisetTests.java:3456)
	at org.jooq.test.all.testcases.MultisetTests.testMultisetAggNestedTableAsFields(MultisetTests.java:445)
	at org.jooq.test.jOOQAbstractTest.testMultisetAggNestedTableAsFields(jOOQAbstractTest.java:5668)

The 22-degree constructors don't have this problem. I.e.:

// Works
row(TABLE)

// Doesn't work
row(List.of(TABLE))
@lukaseder
Copy link
Member Author

This issue was discovered when writing a test for #15007

@lukaseder
Copy link
Member Author

Fixed in jOOQ 3.19.0, 3.18.4 (#15009), and 3.17.13 (#15010)

3.19 Other improvements automation moved this from To do to Done May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant