Let's take the query from my other question:
SelectConditionStep<Record1<String>> query = create
.select(AUTHOR.LASTNAME.as("AuthorName"))
.from(
(
BOOK.leftOuterJoin(BOOK_AUTHOR).on(BOOK.ID.eq(BOOK_AUTHOR.BOOKID))
).leftOuterJoin(AUTHOR).on(AUTHOR.ID.eq(BOOK_AUTHOR.AUTHORID))
)
.where(BOOK.ID.eq(1))
;
//when
Result<Record1<String>> result = query.fetch();
If I try to replace SelectConditionStep<Record1<String>>
with SelectConditionStep<Record>
, I get
Incompatible types.
Required:
SelectConditionStep<org.jooq.Record>
Found:
SelectConditionStep<org.jooq.Record1<java.lang.String>>
and yet ...
package org.jooq;
import javax.annotation.Generated;
/**
* A model type for a records with degree <code>1</code>
*
* @see Row1
* @author Lukas Eder
*/
@Generated("This class was generated using jOOQ-tools")
public interface Record1<T1> extends Record {...}
So ... what gives?
Unless I'm missing something very obvious, shouldn't I be allowed to treat instances of Record1
as if they were Record
s?
(And yes, I started questioning myself to the point I needed to check I'm not completely mental: https://ideone.com/0O4mOU )