public Object readSqlResultRecord(ResultSet result) { try { // get the xml and parse into a Resource String xml = result.getString(1); Entity entry = readResource(container, xml); return entry; } catch (SQLException ignore) { return null; } } });
public Object readSqlResultRecord(ResultSet result) { try { // get the xml and parse into a Resource String xml = result.getString(1); Entity entry = readResource(container, xml); return entry; } catch (SQLException ignore) { return null; } } });
/** * Get the Resource with this id, or null if not found. * * @param container * The container for this resource. * @param id * The id. * @return The Resource with this id, or null if not found. */ public Entity getResource(Entity container, String id) { Entity entry = null; // get the user from the db String sql = doubleStorageSql.getSelectXml4Sql(m_resourceTableName, m_resourceTableIdField, m_resourceTableContainerIdField); Object[] fields = new Object[2]; fields[0] = container.getReference(); fields[1] = id; List xml = m_sql.dbRead(sql, fields, null); if (!xml.isEmpty()) { // create the Resource from the db xml entry = readResource(container, (String) xml.get(0)); } return entry; }
/** * Get the Resource with this id, or null if not found. * * @param container * The container for this resource. * @param id * The id. * @return The Resource with this id, or null if not found. */ public Entity getResource(Entity container, String id) { Entity entry = null; // get the user from the db String sql = doubleStorageSql.getSelectXml4Sql(m_resourceTableName, m_resourceTableIdField, m_resourceTableContainerIdField); Object[] fields = new Object[2]; fields[0] = container.getReference(); fields[1] = id; List xml = m_sql.dbRead(sql, fields, null); if (!xml.isEmpty()) { // create the Resource from the db xml entry = readResource(container, (String) xml.get(0)); } return entry; }
Entity entry = readResource(m_container, theXml); if ( entry == null ) return null;
Entity entry = readResource(m_container, theXml); if ( entry == null ) return null;
Entity entry = readResource(container, result.toString()); edit = m_user.newResourceEdit(container, entry);
Entity entry = readResource(container, result.toString()); edit = m_user.newResourceEdit(container, entry);