[#5715] ArrayIndexOutOfBoundsException when fetching an unnamed column from SQL Server with plain SQL

This commit is contained in:
lukaseder 2016-12-20 17:40:12 +01:00
parent 6df93ecc58
commit d4dde9bb40

View File

@ -40,6 +40,8 @@
*/
package org.jooq.impl;
import static org.jooq.tools.StringUtils.defaultIfNull;
import java.util.Arrays;
import org.jooq.Context;
@ -68,7 +70,7 @@ final class QualifiedField<T> extends AbstractField<T> implements TableField<Rec
private final Table<Record> table;
QualifiedField(Name name, DataType<T> type) {
super(name.getName()[name.getName().length - 1], type);
super(defaultIfNull(name.last(), ""), type);
this.name = name;
this.table = name.getName().length > 1