referencing columns
Lukas Eder
lukas.eder at gmail.com
Fri May 4 15:13:17 UTC 2018
Well, I'm mentioning this because I've never seen a type T extends
Iterable<T>. It sounds weird and intriguing, but that's not always a good
thing :). It would allow for things like:
for (Column c1 : columns)
for (Column c2 : c1)
for (Column c3 : c2)
; // What do these even mean?
In your alternative design, ColumnIterator and ColumnCursor don't seem
strictly necessary. This would suffice:
public interface Row extends Iterable<Column>{
public long rowNumber();
public Row cancel();
public Column at(String id);
public Column at(int index);
// forEach, iterator, spliterator
}
public interface Column {
public <T> T get(Class<T> type);
public SqlType sqlType();
public <T> Class<T> javaType();
public String id();
public int index();
}
2018-05-04 16:28 GMT+02:00 Douglas Surber <douglas.surber at oracle.com>:
> I encourage you to actually write some code using both and see what you
> think.
>
I will definitely do things like in the beginning of this email, trying to
"break" the API :)
More information about the jdbc-spec-discuss
mailing list