public QueryImpl(Collection.Key[] columnNames, Array[] arrColumns, String name) throws DatabaseException {
this.name=name;
if(columnNames.length!=arrColumns.length)
throw new DatabaseException("invalid parameter for query, not the same count from names and columns","names:"+columnNames.length+";columns:"+arrColumns.length,null,null);
int len=0;
columns=new QueryColumnImpl[arrColumns.length];
if(arrColumns.length>0) {
// test columns
len=arrColumns[0].size();
for(int i=0;i<arrColumns.length;i++) {
if(arrColumns[i].size()!=len)
throw new DatabaseException("invalid parameter for query, all columns must have the same size","column[1]:"+len+"<>column["+(i+1)+"]:"+arrColumns[i].size(),null,null);
//columns[i]=new QueryColumnTypeFlex(arrColumns[i]);
columns[i]=new QueryColumnImpl(this,columnNames[i],arrColumns[i],Types.OTHER);
}
// test keys
validateColumnNames(columnNames);