I am trying to do something like:
t.set(field("ColumnName"), select(max(field("ColumnName"))).from("TableName"));
But I am getting the following compile error:
Ambiguous method call, Both
set(Field,Object) in InsertSetStep and
set(Field,Select<? extends Record1>) in InsertSetStep match
I have tried to resolve the ambiguity with casting, but I still receive the same error
Select<? extends Record1> sq = select(max(field("ColumnName"))).from("TableName");
t.set( field("ColumnName"), (Select<? extends Record1>)sq );
I have a couple questions:
- Why does casting not resolve the ambiguity in this scenario? (I have tried casting to
(Object)
and that does resolve the ambiguity) - Is there a way for me to resolve the ambiguity?