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

gu.sql2java.observer.SimpleRowMetaData Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package gu.sql2java.observer;

import static com.google.common.base.Preconditions.*;
import static gu.sql2java.observer.JDBCUtility.getColumnNames;
import static gu.sql2java.observer.JDBCUtility.getColumnTypes;
import static gu.sql2java.observer.JDBCUtility.getSqlTypes;
import static gu.sql2java.utils.JDBCUtility.getColumnTypeNames;

import java.sql.DatabaseMetaData;
import java.util.Map;

import gu.sql2java.RowMetaData;
import gu.sql2java.UnnameRow;

/**
 * 简单表元数据,只提供表字段名列表,字段类型等基本数据用于JSON数据反序列化
 * @author guyadong
 *
 */
public class SimpleRowMetaData extends RowMetaData{
	SimpleRowMetaData(DatabaseMetaData  metaData, String tablename, Map> targetTypes) {
		super(tablename, 
				"TABLE", 
				UnnameRow.class, 
				null, 
				null, 
				null, 
				getColumnNames(checkNotNull(metaData,"metaData is null"),null,tablename), 
				getColumnTypeNames(checkNotNull(metaData,"metaData is null"),null,tablename), 
				null, 
				null, 
				null, 
				getColumnTypes(metaData,null,tablename,targetTypes), 
				null, getSqlTypes(metaData,null,tablename), null, null, null, null, null, null, null, null);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy