gu.sql2java.UnnameRowMetaData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sql2java-base Show documentation
Show all versions of sql2java-base Show documentation
sql2java common class package
package gu.sql2java;
import static com.google.common.base.Preconditions.*;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
class UnnameRowMetaData extends RowMetaData{
UnnameRowMetaData(ResultSetMetaData metaData, Map> targetTypes) {
super(UNKNOW_TABLENAME,
UNKNOW_TABLETYPE,
UnnameRow.class,
null,
null,
getColumnNames(checkNotNull(metaData,"metaData is null")),
null,
null,
null,
getColumnTypes(metaData,targetTypes),
getSqlTypes(metaData), null, null, null, null, null, null, null);
}
private final static List getColumnNames(ResultSetMetaData metaData){
try {
String[] names = new String[metaData.getColumnCount()];
for(int i=0; i[] getColumnTypes(ResultSetMetaData metaData,
Map> targetTypes){
try {
targetTypes = MoreObjects.firstNonNull(targetTypes, Collections.>emptyMap());
Class>[] types = new Class>[metaData.getColumnCount()];
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy