All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gu.sql2java.UnnameRowMetaData Maven / Gradle / Ivy

There is a newer version: 5.3.2
Show newest version
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), 
				null, 
				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