【发布时间】:2019-08-09 18:38:53
【问题描述】:
让我们从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();
如果我尝试用SelectConditionStep<Record> 替换SelectConditionStep<Record1<String>>,我会得到
不兼容的类型。
必填:
SelectConditionStep<org.jooq.Record>找到:
SelectConditionStep<org.jooq.Record1<java.lang.String>>
然而……
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 {...}
那么……什么给了?
除非我遗漏了一些非常明显的东西,否则我是否应该被允许将Record1 的实例视为Records 处理?
(是的,我开始质疑自己,以至于我需要检查自己是否完全没有精神:https://ideone.com/0O4mOU)
【问题讨论】:
标签: java generics inheritance polymorphism jooq