protected Serializable newIdArray(Collection<Serializable> ids) { if (dialect.supportsArrays()) { return ids.toArray(); // Object[] } else { // join with '|' StringBuilder b = new StringBuilder(); for (Serializable id : ids) { b.append(id); b.append('|'); } b.setLength(b.length() - 1); return b.toString(); } }
protected void prepareUserReadAcls(QueryFilter queryFilter) { String sql = dialect.getPrepareUserReadAclsSql(); Serializable principals = queryFilter.getPrincipals(); if (sql == null || principals == null) { return; } if (!dialect.supportsArrays()) { principals = String.join(Dialect.ARRAY_SEP, (String[]) principals); } try (PreparedStatement ps = connection.prepareStatement(sql)) { if (logger.isLogEnabled()) { logger.logSQL(sql, Collections.singleton(principals)); } setToPreparedStatement(ps, 1, principals); ps.execute(); countExecute(); } catch (SQLException e) { throw new NuxeoException("Failed to prepare user read acl cache", e); } }
if (dialect.supportsArrays() && columns.get(2).getJdbcType() == Types.ARRAY) { frags = fragments.split(" "); } else {
int kind = ((Long) columns.get(3).getFromResultSet(rs, 3)).intValue(); String[] fragments; if (dialect.supportsArrays() && frags instanceof String[]) { fragments = (String[]) frags; } else {
Serializable principals = queryFilter.getPrincipals(); Serializable permissions = queryFilter.getPermissions(); if (!dialect.supportsArrays()) { principals = StringUtils.join((String[]) principals, Dialect.ARRAY_SEP); permissions = StringUtils.join((String[]) permissions, Dialect.ARRAY_SEP);