Search in sources :

Example 6 with ApsEntityRecord

use of com.agiletec.aps.system.common.entity.model.ApsEntityRecord in project entando-core by entando.

the class AbstractEntitySearcherDAO method searchRecords.

@Override
public List<ApsEntityRecord> searchRecords(EntitySearchFilter[] filters) {
    Connection conn = null;
    List<ApsEntityRecord> records = new ArrayList<>();
    PreparedStatement stat = null;
    ResultSet result = null;
    try {
        conn = this.getConnection();
        stat = this.buildStatement(filters, true, conn);
        result = stat.executeQuery();
        while (result.next()) {
            ApsEntityRecord record = this.createRecord(result);
            if (!records.contains(record)) {
                records.add(record);
            }
        }
    } catch (Throwable t) {
        _logger.error("Error while loading records list", t);
        throw new RuntimeException("Error while loading records list", t);
    } finally {
        closeDaoResources(result, stat, conn);
    }
    return records;
}
Also used : ApsEntityRecord(com.agiletec.aps.system.common.entity.model.ApsEntityRecord) Connection(java.sql.Connection) ArrayList(java.util.ArrayList) ResultSet(java.sql.ResultSet) PreparedStatement(java.sql.PreparedStatement)

Aggregations

ApsEntityRecord (com.agiletec.aps.system.common.entity.model.ApsEntityRecord)6 EntitySearchFilter (com.agiletec.aps.system.common.entity.model.EntitySearchFilter)3 Connection (java.sql.Connection)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 ArrayList (java.util.ArrayList)1