package com.ibm.si.jaql.jdbc;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;


/**
 * Ariel query, result set, Meta data base pojo.
 * The general use case for QueryFieldMetaData is to take ArielColumn data, and build an enriched more compliant 
 * jdbc compliant MetaData object.
 * MetaDataBuilder can use this object to  
 * 
 * @author IBM
 *
 */
public class QueryFieldMetaData
{
	static final Logger logger = LogManager.getLogger(QueryFieldMetaData.class.getName());
	
	public String catalog; 			//TABLE_CAT
	public String schema;			//TABLE_SCHEM 
	public String tableName;		//TABLE_NAME
	public String name; 			//COLUMN_NAME
	public String alias;			
	public boolean isFunction;
	public int type;				//DATA_TYPE
	public String typeName;			//TYPE_NAME
	public int columnSize;			//COLUMN_SIZE
	public int decimalDigits;		//DECIMAL_DIGITS
		
	@Override
	public String toString()
	{
		logger.debug(String.format("FieldName=%s, Alias=%s, Function=%b, Type=%d, tableName=%s, schema=%s, catalog=%s, type=%d, typeName=%s, columnSize=%d, decimalDigits=%d ",
										name, alias, isFunction, type, tableName, schema, catalog, type, typeName, columnSize, decimalDigits ));
		return String.format("FieldName=%s, Alias=%s, Function=%b, Type=%d, tableName=%s, schema=%s, catalog=%s", name, alias, isFunction, type, tableName, schema, catalog);
	}
}
@@ -938,32 +938,33 @@
 (String.format(%22
+%7B
 FieldName=%25s, Al
@@ -1083,17 +1083,17 @@
 igits=%25d
- 
+%7D
 %22,%0A%09%09%09%09%09
@@ -1226,16 +1226,17 @@
 format(%22
+%7B
 FieldNam
@@ -1308,16 +1308,17 @@
 talog=%25s
+%7D
 %22, name,

Tweak to the formatting to make it easier to read when printing lists of QueryFieldMetaData objects.