public List getAllResourcesWhereLike(String field, String value) { String sql = singleStorageSql.getXmlLikeSql(field, m_resourceTableName); Object[] fields = new Object[1]; fields[0] = value; // %%% + "order by " + m_resourceTableOrderField + " asc"; return loadResources(sql, fields); }
public List getAllResourcesWhereLike(String field, String value) { String sql = singleStorageSql.getXmlLikeSql(field, m_resourceTableName); Object[] fields = new Object[1]; fields[0] = value; // %%% + "order by " + m_resourceTableOrderField + " asc"; return loadResources(sql, fields); }
/** * Get all Resources where the given field matches the given value. * * @param field * The db field name for the selection. * @param value * The value to select. * @return The list of all Resources that meet the criteria. */ public List getAllResourcesWhere(String field, String value) { // read all users from the db String sql = singleStorageSql.getXmlSql(field, m_resourceTableName); Object[] fields = new Object[1]; fields[0] = value; // %%% + "order by " + m_resourceTableOrderField + " asc"; return loadResources(sql, fields); }
/** * Get a limited number of Resources a given field matches a given value, returned in ascending order * by another field. The limit on the number of rows is specified by values for the first item to be * retrieved (indexed from 0) and the maxCount. * @param selectBy The name of a field to be used in selecting resources. * @param selectByValue The value to select. * @param orderBy The name of a field to be used in ordering the resources. * @param tableName The table on which the query is to operate * @param first A non-negative integer indicating the first record to return * @param maxCount A positive integer indicating the maximum number of rows to return * @return The list of all Resources that meet the criteria. */ public List getAllResourcesWhere(String selectBy, String selectByValue, String orderBy, int first, int maxCount) { // read all users from the db String sql = singleStorageSql.getXmlWhereLimitSql(selectBy, orderBy, m_resourceTableName, first, maxCount); Object[] fields = new Object[1]; fields[0] = selectByValue; // %%% + "order by " + m_resourceTableOrderField + " asc"; return loadResources(sql, fields); }
public List getAllResources() { List all = new Vector(); // read all users from the db List xml = null; String sql = singleStorageSql.getXmlSql(m_resourceTableName); xml = loadResources(sql, null); // %%% + "order by " + m_resourceTableOrderField + " asc"; // process all result xml into user objects if (!xml.isEmpty()) { for (int i = 0; i < xml.size(); i++) { Entity entry = (Entity) xml.get(i); if (entry != null) all.add(entry); } } return all; }
/** * Get all Resources where the given field matches the given value. * * @param field * The db field name for the selection. * @param value * The value to select. * @return The list of all Resources that meet the criteria. */ public List getAllResourcesWhere(String field, String value) { // read all users from the db String sql = singleStorageSql.getXmlSql(field, m_resourceTableName); Object[] fields = new Object[1]; fields[0] = value; // %%% + "order by " + m_resourceTableOrderField + " asc"; return loadResources(sql, fields); }
public List getAllResources() { List all = new Vector(); // read all users from the db List xml = null; String sql = singleStorageSql.getXmlSql(m_resourceTableName); xml = loadResources(sql, null); // %%% + "order by " + m_resourceTableOrderField + " asc"; // process all result xml into user objects if (!xml.isEmpty()) { for (int i = 0; i < xml.size(); i++) { Entity entry = (Entity) xml.get(i); if (entry != null) all.add(entry); } } return all; }
/** * Get a limited number of Resources a given field matches a given value, returned in ascending order * by another field. The limit on the number of rows is specified by values for the first item to be * retrieved (indexed from 0) and the maxCount. * @param selectBy The name of a field to be used in selecting resources. * @param selectByValue The value to select. * @param orderBy The name of a field to be used in ordering the resources. * @param tableName The table on which the query is to operate * @param first A non-negative integer indicating the first record to return * @param maxCount A positive integer indicating the maximum number of rows to return * @return The list of all Resources that meet the criteria. */ public List getAllResourcesWhere(String selectBy, String selectByValue, String orderBy, int first, int maxCount) { // read all users from the db String sql = singleStorageSql.getXmlWhereLimitSql(selectBy, orderBy, m_resourceTableName, first, maxCount); Object[] fields = new Object[1]; fields[0] = selectByValue; // %%% + "order by " + m_resourceTableOrderField + " asc"; return loadResources(sql, fields); }
/** * Get selected Resources, using a supplied where clause * * @param sqlWhere * The SQL where clause. * @return The list of selected Resources. */ public List getSelectedResourcesWhere(String sqlWhere) { List all = new Vector(); // read all users from the db String sql = singleStorageSql.getXmlWhereSql(m_resourceTableName, sqlWhere); List xml = loadResources(sql, null); // process all result xml into user objects if (!xml.isEmpty()) { for (int i = 0; i < xml.size(); i++) { Entity entry = (Entity) xml.get(i); if (entry != null) all.add(entry); } } return all; }
public List getAllResources(int first, int last) { Object[] fields = singleStorageSql.getXmlFields(first, last); List xml = null; String sql = singleStorageSql.getXmlSql(m_resourceTableIdField, m_resourceTableName, first, last); xml = loadResources(sql, fields); List rv = new Vector(); // process all result xml into user objects if (!xml.isEmpty()) { for (int i = 0; i < xml.size(); i++) { Entity entry = (Entity) xml.get(i); if (entry != null) rv.add(entry); } } return rv; }
public List getAllResources(int first, int last) { Object[] fields = singleStorageSql.getXmlFields(first, last); List xml = null; String sql = singleStorageSql.getXmlSql(m_resourceTableIdField, m_resourceTableName, first, last); xml = loadResources(sql, fields); List rv = new Vector(); // process all result xml into user objects if (!xml.isEmpty()) { for (int i = 0; i < xml.size(); i++) { Entity entry = (Entity) xml.get(i); if (entry != null) rv.add(entry); } } return rv; }
/** * Get selected Resources, using a supplied where clause * * @param sqlWhere * The SQL where clause. * @return The list of selected Resources. */ public List getSelectedResourcesWhere(String sqlWhere) { List all = new Vector(); // read all users from the db String sql = singleStorageSql.getXmlWhereSql(m_resourceTableName, sqlWhere); List xml = loadResources(sql, null); // process all result xml into user objects if (!xml.isEmpty()) { for (int i = 0; i < xml.size(); i++) { Entity entry = (Entity) xml.get(i); if (entry != null) all.add(entry); } } return all; }
/** * Get the Resource with this id, or null if not found. * * @param id * The id. * @return The Resource with this id, or null if not found. */ public Entity getResource(String id) { Entity entry = null; // get the user from the db List xml = null; String sql = singleStorageSql.getXmlSql(m_resourceTableIdField, m_resourceTableName); Object fields[] = new Object[1]; fields[0] = caseId(id); xml = loadResources(sql, fields); if (!xml.isEmpty()) { // create the Resource from the db xml entry = (Entity) xml.get(0); } return entry; }
/** * Get the Resource with this id, or null if not found. * * @param id * The id. * @return The Resource with this id, or null if not found. */ public Entity getResource(String id) { Entity entry = null; // get the user from the db List xml = null; String sql = singleStorageSql.getXmlSql(m_resourceTableIdField, m_resourceTableName); Object fields[] = new Object[1]; fields[0] = caseId(id); xml = loadResources(sql, fields); if (!xml.isEmpty()) { // create the Resource from the db xml entry = (Entity) xml.get(0); } return entry; }