[#1751] Result.intoResultSet() generates wrong ResultSetMetaData

if runtime schema mapping is applied
This commit is contained in:
Lukas Eder 2012-08-28 19:58:46 +02:00
parent 7d569a9e54
commit bea0a4917b

View File

@ -61,6 +61,8 @@ import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;
import org.jooq.AttachableInternal;
import org.jooq.Configuration;
import org.jooq.Field;
import org.jooq.Record;
import org.jooq.Result;
@ -1233,7 +1235,19 @@ class ResultSetImpl extends JDBC41ResultSet implements ResultSet, Serializable {
Schema schema = table.getSchema();
if (schema != null) {
return schema.getName();
Configuration configuration = ((AttachableInternal) result).getConfiguration();
Schema mapped = null;
if (configuration != null) {
mapped = Util.getMappedSchema(configuration, schema);
}
if (mapped != null) {
return mapped.getName();
}
else {
return schema.getName();
}
}
}
}