mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
added utility method for loading a table that takes in a filter
This commit is contained in:
@ -292,9 +292,26 @@ public class GeneralProcessUtils
|
||||
** too many rows... Caveat emptor.
|
||||
*******************************************************************************/
|
||||
public static <T extends QRecordEntity> List<T> loadTable(String tableName, Class<T> entityClass) throws QException
|
||||
{
|
||||
return (loadTable(tableName, entityClass, null));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Load all rows from a table as a RecordEntity, takes in a filter as well
|
||||
**
|
||||
** Note, this is inherently unsafe, if you were to call it on a table with
|
||||
** too many rows... Caveat emptor.
|
||||
*******************************************************************************/
|
||||
public static <T extends QRecordEntity> List<T> loadTable(String tableName, Class<T> entityClass, QQueryFilter filter) throws QException
|
||||
{
|
||||
QueryInput queryInput = new QueryInput();
|
||||
queryInput.setTableName(tableName);
|
||||
if(filter != null)
|
||||
{
|
||||
queryInput.setFilter(filter);
|
||||
}
|
||||
QueryOutput queryOutput = new QueryAction().execute(queryInput);
|
||||
|
||||
List<T> rs = new ArrayList<>();
|
||||
|
Reference in New Issue
Block a user