public List<CmsResource> readResourcesWithProperty(
        CmsDbContext dbc,
        CmsUUID projectId,
        CmsUUID propertyDef,
        String path,
        String value)
    throws CmsDataAccessException {

        List<CmsResource> resources = new ArrayList<CmsResource>();
        ResultSet res = null;
        PreparedStatement stmt = null;
        Connection conn = null;

        try {
            conn = m_sqlManager.getConnection(dbc);
            if (value == null) {
                stmt = m_sqlManager.getPreparedStatement(conn, projectId, "C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF");
                stmt.setString(1, propertyDef.toString());
                stmt.setString(2, path + "%");
                stmt.setString(3, propertyDef.toString());
                stmt.setString(4, path + "%");
            } else {
                stmt = m_sqlManager.getPreparedStatement(
                    conn,
                    projectId,
                    "C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF_VALUE");
                stmt.setString(1, propertyDef.toString());
                stmt.setString(2, path + "%");
                stmt.setString(3, "%" + value + "%");
                stmt.setString(4, propertyDef.toString());
                stmt.setString(5, path + "%");
                stmt.setString(6, "%" + value + "%");
            }
            res = stmt.executeQuery();

            while (res.next()) {
                CmsResource resource = createResource(res, projectId);
                resources.add(resource);
            }
        } catch (SQLException e) {
            throw new CmsDbSqlException(
                Messages.get().container(Messages.ERR_GENERIC_SQL_1, CmsDbSqlException.getErrorQuery(stmt)),
                e);
        } finally {
            m_sqlManager.closeAll(dbc, conn, stmt, res);
        }

        return resources;
    }
public List < CmsResource > readResourcesWithProperty ( CmsDbContext dbc , CmsUUID projectId , CmsUUID propertyDef , String path , String value ) throws CmsDataAccessException { List < CmsResource > resources = new ArrayList < CmsResource > ( ) ; ResultSet res = null ; PreparedStatement stmt = null ; Connection conn = null ; try { conn = m_sqlManager . getConnection ( dbc ) ; if ( value == null ) { stmt = m_sqlManager . getPreparedStatement ( conn , projectId , "C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF" ) ; stmt . setString ( 1 , propertyDef . toString ( ) ) ; stmt . setString ( 2 , path + "%" ) ; stmt . setString ( 3 , propertyDef . toString ( ) ) ; stmt . setString ( 4 , path + "%" ) ; } else { stmt = m_sqlManager . getPreparedStatement ( conn , projectId , "C_RESOURCES_GET_RESOURCE_WITH_PROPERTYDEF_VALUE" ) ; stmt . setString ( 1 , propertyDef . toString ( ) ) ; stmt . setString ( 2 , path + "%" ) ; stmt . setString ( 3 , "%" + value + "%" ) ; stmt . setString ( 4 , propertyDef . toString ( ) ) ; stmt . setString ( 5 , path + "%" ) ; stmt . setString ( 6 , "%" + value + "%" ) ; } res = stmt . executeQuery ( ) ; while ( res . next ( ) ) { CmsResource resource = createResource ( res , projectId ) ; resources . add ( resource ) ; } } catch ( SQLException e ) { throw new CmsDbSqlException ( Messages . get ( ) . container ( Messages . ERR_GENERIC_SQL_1 , CmsDbSqlException . getErrorQuery ( stmt ) ) , e ) ; } finally { m_sqlManager . closeAll ( dbc , conn , stmt , res ) ; } return resources ; }
@see org.opencms.db.I_CmsVfsDriver#readResourcesWithProperty(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.util.CmsUUID, String, String)