Vector rowData = new Vector();
Column column = (Column)columnIter.next();
rowData.add(column);
model.addRow(rowData);
}
DAO dao = DAO.getInstance();
dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_FOR_DISPLAY);
dao.setInt(1, object.getClsId());
dao.setInt(2, layout);
ResultSet rs = dao.executeQuery();
try {
while (rs.next()) {
String tableName = rs.getString("TABLENAME");
String columnName = rs.getString("COLUMNNAME");
int disordinal = rs.getInt("DISORDINAL");
for (int i = 0 ; i <= model.getRowCount(); i++) {
Column column = (Column)model.getValueAt(i, 0);
if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) && (disordinal > 0) ) {
model.removeRow(i);
break;
}
}
}
rs.close();
} catch (Exception e) {
}
model = (DefaultTableModel)getColumnDisplayTable().getModel();
dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_FOR_DISPLAY);
dao.setInt(1, object.getClsId());
dao.setInt(2, layout);
rs = dao.executeQuery();
try {
while (rs.next()) {
String tableName = rs.getString("TABLENAME");
String columnName = rs.getString("COLUMNNAME");
int disordinal = rs.getInt("DISORDINAL");
columnIter = object.getColumns().iterator();
while (columnIter.hasNext()) {
Column column = (Column)columnIter.next();
if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) && (disordinal > 0) ) {
Vector rowData = new Vector();
rowData.add(column);
if (column.isCountble())
rowData.add(rs.getBoolean("ISCOUNT"));
else
rowData.add(null);
if (column.isSumble())
rowData.add(rs.getBoolean("ISSUMMARY"));
else
rowData.add(null);
model.addRow(rowData);
break;
}
}
}
rs.close();
} catch (Exception e) {
}
model = (DefaultTableModel)getColumnOrderSourceTable().getModel();
dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_ORDERBY_ORDERBYORDINAL);
dao.setInt(1, object.getClsId());
dao.setInt(2, layout);
rs = dao.executeQuery();
try {
while (rs.next()) {
String tableName = rs.getString("TABLENAME");
String columnName = rs.getString("COLUMNNAME");
columnIter = object.getColumns().iterator();
while (columnIter.hasNext()) {
Column column = (Column)columnIter.next();
if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) ) {
Vector rowData = new Vector();
rowData.add(column);
model.addRow(rowData);
break;
}
}
}
rs.close();
} catch (Exception e) {
}
model = (DefaultTableModel)getColumnOrderTable().getModel();
dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_ORDERBY_ORDERBYORDINAL_FOR_ORDERBY);
dao.setInt(1, object.getClsId());
dao.setInt(2, layout);
rs = dao.executeQuery();
try {
while (rs.next()) {
String tableName = rs.getString("TABLENAME");
String columnName = rs.getString("COLUMNNAME");
columnIter = object.getColumns().iterator();
while (columnIter.hasNext()) {
Column column = (Column)columnIter.next();
if ( (column.getTableName().equals(tableName)) && (column.getColumnName().equals(columnName)) ) {
Vector rowData = new Vector();
rowData.add(column);
if (rs.getObject("ORDERBYASCDES") == null)
rowData.add(new Boolean(false));
else
rowData.add(rs.getBoolean("ORDERBYASCDES"));
model.addRow(rowData);
break;
}
}
}
rs.close();
} catch (Exception e) {
}
model = (DefaultTableModel)getColumnAllTable().getModel();
columnIter = object.getColumns().iterator();
while (columnIter.hasNext()) {
Column column = (Column)columnIter.next();
Vector rowData = new Vector();
dao.query(Resources.SELECT_CLFIELDS_BY_CLSID_AND_LAYOUT_AND_TABLENAME_AND_COLUMNNAME);
dao.setInt(1, object.getClsId());
dao.setInt(2, layout);
dao.setString(3, column.getTableName());
dao.setString(4, column.getColumnName());
rs = dao.executeQuery();
try {
if (rs.next()) {
if (rs.getBoolean("ANDOR") == true)
rowData.add("AND");
else
rowData.add("OR");
rowData.add(column);
if (rs.getString("FILTERCLAUSE") == null)
rowData.add("");
else
rowData.add(rs.getString("FILTERCLAUSE"));
} else {
rowData.add("AND");
rowData.add(column);
rowData.add("");
}
model.addRow(rowData);
rs.close();
} catch (SQLException e) {
}
}
//add CSQL
dao.query(Resources.SELECT_CL_SQL);
dao.setInt(1, object.getClsId());
dao.setInt(2, layout);
rs=dao.executeQuery();
try {
if(rs.next()){
csqlPanel.setText(rs.getString("CSQL"));
}
rs.close();