
dk.eobjects.metamodel.data.DataSet Maven / Gradle / Ivy
/**
* This file is part of MetaModel.
*
* MetaModel is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* MetaModel is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MetaModel. If not, see .
*/
package dk.eobjects.metamodel.data;
import java.io.Closeable;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.TableModel;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import dk.eobjects.metamodel.MetaModelException;
import dk.eobjects.metamodel.query.Query;
import dk.eobjects.metamodel.query.SelectItem;
public class DataSet implements Closeable {
private IDataSetStrategy _strategy;
public DataSet(Query query, Statement statement, ResultSet resultSet) {
this(new JdbcDataSetStrategy(query, statement, resultSet));
}
public DataSet(SelectItem[] selectItems, Statement statement,
ResultSet resultSet) {
this(new JdbcDataSetStrategy(selectItems, statement, resultSet));
}
public DataSet(IDataSetStrategy strategy) {
if (strategy == null) {
throw new IllegalArgumentException("Strategy cannot be null");
}
_strategy = strategy;
}
public DataSet(SelectItem[] selectItems, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy