org.openanzo.server.repository.rdb.sql
Class AclRdbWrapper

java.lang.Object
  extended by org.openanzo.server.repository.rdb.sql.AclRdbWrapper

public class AclRdbWrapper
extends java.lang.Object

AclRdbWrapper provides wrappers around SQL queries and transforms ResultSets into java objects

Author:
Generated Source from org.openanzo.jdbc.utils.opgen.jet

Nested Class Summary
static interface AclRdbWrapper.GetRoleAciParams
          Interface for managing the parameters to the getRoleAci prepared statement.
static class AclRdbWrapper.GetRoleAciParamsImpl
          Default implementation of GetRoleAciParams
static interface AclRdbWrapper.SelectRolesForNamedGraphNoWithParams
          Interface for managing the parameters to the selectRolesForNamedGraphNoWith prepared statement.
static class AclRdbWrapper.SelectRolesForNamedGraphNoWithParamsImpl
          Default implementation of SelectRolesForNamedGraphNoWithParams
static interface AclRdbWrapper.SelectUserHasAccessParams
          Interface for managing the parameters to the selectUserHasAccess prepared statement.
static class AclRdbWrapper.SelectUserHasAccessParamsImpl
          Default implementation of SelectUserHasAccessParams
static interface AclRdbWrapper.SelectUserHasAccessResult
          Interface for holding the results of the selectUserHasAccess prepared statement.
static class AclRdbWrapper.SelectUserHasAccessResultImpl
          Default implementation of SelectUserHasAccessResult
static interface AclRdbWrapper.SelectUsersForNamedGraphsNoWithParams
          Interface for managing the parameters to the selectUsersForNamedGraphsNoWith prepared statement.
static class AclRdbWrapper.SelectUsersForNamedGraphsNoWithParamsImpl
          Default implementation of SelectUsersForNamedGraphsNoWithParams
 
Field Summary
static java.lang.String getRoleAci
          Constant "getRoleAci" used to reference prepared statement Acl.getRoleAci SELECT ACIS.ID AS ID FROM ACIS WHERE ACIS.ACLID = ? AND ACIS.ROLEID = ? AND ACIS.HEND IS NULL;
static java.lang.String selectAclItems
          Constant "selectAclItems" used to reference prepared statement Acl.selectAclItems SELECT ID AS ID FROM ACIS WHERE ACLID = ? AND HEND IS NULL;
static java.lang.String selectNamedGraphsUseAcl
          Constant "selectNamedGraphsUseAcl" used to reference prepared statement Acl.selectNamedGraphsUseAcl SELECT NG.ID FROM NAMEDGRAPHS NG WHERE NG.ACLID = ? AND NG.HEND IS NULL;
static java.lang.String selectRolesForNamedGraph
          Constant "selectRolesForNamedGraph" used to reference prepared statement Acl.selectRolesForNamedGraph WITH LT (COMMITED) AS ( SELECT MAX(COMMITED) FROM TRANSACTIONTIMES ) SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT DISTINCT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS,LT WHERE NG.ID = ? AND NG.HSTART <= LT.COMMITED AND (NG.HEND IS NULL OR NG.HEND > LT.COMMITED) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= LT.COMMITED AND (ACIS.HEND IS NULL OR ACIS.HEND > LT.COMMITED) AND ACIS.CANREAD=1 );
static java.lang.String selectRolesForNamedGraphNoWith
          Constant "selectRolesForNamedGraphNoWith" used to reference prepared statement Acl.selectRolesForNamedGraphNoWith SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.ID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 );
static java.lang.String selectUserHasAccess
          Constant "selectUserHasAccess" used to reference prepared statement Acl.selectUserHasAccess SELECT SUM(ACIS.CANREAD) AS CANREAD, SUM(ACIS.CANADD) AS CANADD, SUM(ACIS.CANREMOVE) AS CANREMOVE, SUM(ACIS.CANINSERTNAMEDGRAPH) AS CANINSERTNAMEDGRAPH, SUM(ACIS.CANREMOVENAMEDGRAPH) AS CANREMOVENAMEDGRAPH, SUM(ACIS.CANCHANGENAMEDGRAPHACL) AS CANCHANGENAMEDGRAPHACL FROM ACIS, USERSROLES UR WHERE ACIS.ACLID = ? AND ACIS.ROLEID = UR.ROLEID AND UR.USERID = ? AND UR.HEND IS NULL AND ACIS.HEND IS NULL ;
static java.lang.String selectUsersForNamedGraphs
          Constant "selectUsersForNamedGraphs" used to reference prepared statement Acl.selectUsersForNamedGraphs WITH LT (COMMITED) AS ( SELECT MAX(COMMITED) FROM TRANSACTIONTIMES ) SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR,LT WHERE UR.HSTART <= LT.COMMITED AND (UR.HEND IS NULL OR UR.HEND > LT.COMMITED) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= LT.COMMITED AND (NG.HEND IS NULL OR NG.HEND > LT.COMMITED) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= LT.COMMITED AND (ACIS.HEND IS NULL OR ACIS.HEND > LT.COMMITED) AND ACIS.CANREAD=1 ) );
static java.lang.String selectUsersForNamedGraphsNoWith
          Constant "selectUsersForNamedGraphsNoWith" used to reference prepared statement Acl.selectUsersForNamedGraphsNoWith SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR WHERE UR.HSTART <= ? AND (UR.HEND IS NULL OR UR.HEND > ?) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 ) );
 
Constructor Summary
AclRdbWrapper()
           
 
Method Summary
static java.lang.Long getRoleAci(PreparedStatementCache sqlCache, AclRdbWrapper.GetRoleAciParams params)
          Runs the getRoleAci prepared statement.
static java.lang.Long getRoleAci(PreparedStatementCache sqlCache, long aclId, long roleId)
          Runs the getRoleAci prepared statement.
static void prepareGetRoleAci(java.sql.PreparedStatement ps, long aclId, long roleId)
          Sets the input parameters for the getRoleAci prepared statement.
static void prepareSelectAclItems(java.sql.PreparedStatement ps, long aclId)
          Sets the input parameters for the selectAclItems prepared statement.
static void prepareSelectNamedGraphsUseAcl(java.sql.PreparedStatement ps, long aclId)
          Sets the input parameters for the selectNamedGraphsUseAcl prepared statement.
static void prepareSelectRolesForNamedGraph(java.sql.PreparedStatement ps, long metaid)
          Sets the input parameters for the selectRolesForNamedGraph prepared statement.
static void prepareSelectRolesForNamedGraphNoWith(java.sql.PreparedStatement ps, java.lang.Long now1, java.lang.Long now2, long metaid, java.lang.Long now3, java.lang.Long now4)
          Sets the input parameters for the selectRolesForNamedGraphNoWith prepared statement.
static void prepareSelectUserHasAccess(java.sql.PreparedStatement ps, long aclId, long userId)
          Sets the input parameters for the selectUserHasAccess prepared statement.
static void prepareSelectUsersForNamedGraphs(java.sql.PreparedStatement ps, long metaid)
          Sets the input parameters for the selectUsersForNamedGraphs prepared statement.
static void prepareSelectUsersForNamedGraphsNoWith(java.sql.PreparedStatement ps, java.lang.Long now1, java.lang.Long now2, long metaid, java.lang.Long now3, java.lang.Long now4, java.lang.Long now5, java.lang.Long now6)
          Sets the input parameters for the selectUsersForNamedGraphsNoWith prepared statement.
static ClosableIterator<java.lang.Long> selectAclItems(PreparedStatementCache sqlCache, long aclId)
          Runs the selectAclItems prepared statement with the default transformer.
static ClosableIterator<java.lang.Long> selectAclItems(PreparedStatementCache sqlCache, long aclId, Transformer<java.lang.Long> transform)
          Runs the selectAclItems prepared statement.
static ClosableIterator<java.lang.Long> selectNamedGraphsUseAcl(PreparedStatementCache sqlCache, long aclId)
          Runs the selectNamedGraphsUseAcl prepared statement with the default transformer.
static ClosableIterator<java.lang.Long> selectNamedGraphsUseAcl(PreparedStatementCache sqlCache, long aclId, Transformer<java.lang.Long> transform)
          Runs the selectNamedGraphsUseAcl prepared statement.
static ClosableIterator<java.lang.String> selectRolesForNamedGraph(PreparedStatementCache sqlCache, long metaid, java.lang.String tableNamePrefix)
          Runs the selectRolesForNamedGraph prepared statement with the default transformer.
static ClosableIterator<java.lang.String> selectRolesForNamedGraph(PreparedStatementCache sqlCache, long metaid, java.lang.String tableNamePrefix, Transformer<java.lang.String> transform)
          Runs the selectRolesForNamedGraph prepared statement.
static ClosableIterator<java.lang.String> selectRolesForNamedGraphNoWith(PreparedStatementCache sqlCache, AclRdbWrapper.SelectRolesForNamedGraphNoWithParams params, java.lang.String tableNamePrefix)
          Runs the selectRolesForNamedGraphNoWith prepared statement.
static ClosableIterator<java.lang.String> selectRolesForNamedGraphNoWith(PreparedStatementCache sqlCache, java.lang.Long now1, java.lang.Long now2, long metaid, java.lang.Long now3, java.lang.Long now4, java.lang.String tableNamePrefix)
          Runs the selectRolesForNamedGraphNoWith prepared statement with the default transformer.
static ClosableIterator<java.lang.String> selectRolesForNamedGraphNoWith(PreparedStatementCache sqlCache, java.lang.Long now1, java.lang.Long now2, long metaid, java.lang.Long now3, java.lang.Long now4, java.lang.String tableNamePrefix, Transformer<java.lang.String> transform)
          Runs the selectRolesForNamedGraphNoWith prepared statement.
static AclRdbWrapper.SelectUserHasAccessResult selectUserHasAccess(PreparedStatementCache sqlCache, AclRdbWrapper.SelectUserHasAccessParams params)
          Runs the selectUserHasAccess prepared statement.
static AclRdbWrapper.SelectUserHasAccessResult selectUserHasAccess(PreparedStatementCache sqlCache, long aclId, long userId)
          Runs the selectUserHasAccess prepared statement.
static AclRdbWrapper.SelectUserHasAccessResult selectUserHasAccess(PreparedStatementCache sqlCache, long aclId, long userId, AclRdbWrapper.SelectUserHasAccessResult result)
          Runs the selectUserHasAccess prepared statement.
static ClosableIterator<java.lang.String> selectUsersForNamedGraphs(PreparedStatementCache sqlCache, long metaid, java.lang.String tableNamePrefix)
          Runs the selectUsersForNamedGraphs prepared statement with the default transformer.
static ClosableIterator<java.lang.String> selectUsersForNamedGraphs(PreparedStatementCache sqlCache, long metaid, java.lang.String tableNamePrefix, Transformer<java.lang.String> transform)
          Runs the selectUsersForNamedGraphs prepared statement.
static ClosableIterator<java.lang.String> selectUsersForNamedGraphsNoWith(PreparedStatementCache sqlCache, AclRdbWrapper.SelectUsersForNamedGraphsNoWithParams params, java.lang.String tableNamePrefix)
          Runs the selectUsersForNamedGraphsNoWith prepared statement.
static ClosableIterator<java.lang.String> selectUsersForNamedGraphsNoWith(PreparedStatementCache sqlCache, java.lang.Long now1, java.lang.Long now2, long metaid, java.lang.Long now3, java.lang.Long now4, java.lang.Long now5, java.lang.Long now6, java.lang.String tableNamePrefix)
          Runs the selectUsersForNamedGraphsNoWith prepared statement with the default transformer.
static ClosableIterator<java.lang.String> selectUsersForNamedGraphsNoWith(PreparedStatementCache sqlCache, java.lang.Long now1, java.lang.Long now2, long metaid, java.lang.Long now3, java.lang.Long now4, java.lang.Long now5, java.lang.Long now6, java.lang.String tableNamePrefix, Transformer<java.lang.String> transform)
          Runs the selectUsersForNamedGraphsNoWith prepared statement.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectAclItems

public static final java.lang.String selectAclItems
Constant "selectAclItems" used to reference prepared statement Acl.selectAclItems SELECT ID AS ID FROM ACIS WHERE ACLID = ? AND HEND IS NULL;

See Also:
Constant Field Values

selectNamedGraphsUseAcl

public static final java.lang.String selectNamedGraphsUseAcl
Constant "selectNamedGraphsUseAcl" used to reference prepared statement Acl.selectNamedGraphsUseAcl SELECT NG.ID FROM NAMEDGRAPHS NG WHERE NG.ACLID = ? AND NG.HEND IS NULL;

See Also:
Constant Field Values

getRoleAci

public static final java.lang.String getRoleAci
Constant "getRoleAci" used to reference prepared statement Acl.getRoleAci SELECT ACIS.ID AS ID FROM ACIS WHERE ACIS.ACLID = ? AND ACIS.ROLEID = ? AND ACIS.HEND IS NULL;

See Also:
Constant Field Values

selectUserHasAccess

public static final java.lang.String selectUserHasAccess
Constant "selectUserHasAccess" used to reference prepared statement Acl.selectUserHasAccess SELECT SUM(ACIS.CANREAD) AS CANREAD, SUM(ACIS.CANADD) AS CANADD, SUM(ACIS.CANREMOVE) AS CANREMOVE, SUM(ACIS.CANINSERTNAMEDGRAPH) AS CANINSERTNAMEDGRAPH, SUM(ACIS.CANREMOVENAMEDGRAPH) AS CANREMOVENAMEDGRAPH, SUM(ACIS.CANCHANGENAMEDGRAPHACL) AS CANCHANGENAMEDGRAPHACL FROM ACIS, USERSROLES UR WHERE ACIS.ACLID = ? AND ACIS.ROLEID = UR.ROLEID AND UR.USERID = ? AND UR.HEND IS NULL AND ACIS.HEND IS NULL ;

See Also:
Constant Field Values

selectUsersForNamedGraphs

public static final java.lang.String selectUsersForNamedGraphs
Constant "selectUsersForNamedGraphs" used to reference prepared statement Acl.selectUsersForNamedGraphs WITH LT (COMMITED) AS ( SELECT MAX(COMMITED) FROM TRANSACTIONTIMES ) SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR,LT WHERE UR.HSTART <= LT.COMMITED AND (UR.HEND IS NULL OR UR.HEND > LT.COMMITED) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= LT.COMMITED AND (NG.HEND IS NULL OR NG.HEND > LT.COMMITED) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= LT.COMMITED AND (ACIS.HEND IS NULL OR ACIS.HEND > LT.COMMITED) AND ACIS.CANREAD=1 ) );

See Also:
Constant Field Values

selectUsersForNamedGraphsNoWith

public static final java.lang.String selectUsersForNamedGraphsNoWith
Constant "selectUsersForNamedGraphsNoWith" used to reference prepared statement Acl.selectUsersForNamedGraphsNoWith SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR WHERE UR.HSTART <= ? AND (UR.HEND IS NULL OR UR.HEND > ?) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 ) );

See Also:
Constant Field Values

selectRolesForNamedGraph

public static final java.lang.String selectRolesForNamedGraph
Constant "selectRolesForNamedGraph" used to reference prepared statement Acl.selectRolesForNamedGraph WITH LT (COMMITED) AS ( SELECT MAX(COMMITED) FROM TRANSACTIONTIMES ) SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT DISTINCT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS,LT WHERE NG.ID = ? AND NG.HSTART <= LT.COMMITED AND (NG.HEND IS NULL OR NG.HEND > LT.COMMITED) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= LT.COMMITED AND (ACIS.HEND IS NULL OR ACIS.HEND > LT.COMMITED) AND ACIS.CANREAD=1 );

See Also:
Constant Field Values

selectRolesForNamedGraphNoWith

public static final java.lang.String selectRolesForNamedGraphNoWith
Constant "selectRolesForNamedGraphNoWith" used to reference prepared statement Acl.selectRolesForNamedGraphNoWith SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.ID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 );

See Also:
Constant Field Values
Constructor Detail

AclRdbWrapper

public AclRdbWrapper()
Method Detail

selectAclItems

public static ClosableIterator<java.lang.Long> selectAclItems(PreparedStatementCache sqlCache,
                                                              long aclId)
                                                       throws AnzoException,
                                                              java.sql.SQLException
Runs the selectAclItems prepared statement with the default transformer. SELECT ID AS ID FROM ACIS WHERE ACLID = ? AND HEND IS NULL;

Parameters:
sqlCache - factory and cache of PreparedStatments
aclId - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

selectAclItems

public static ClosableIterator<java.lang.Long> selectAclItems(PreparedStatementCache sqlCache,
                                                              long aclId,
                                                              Transformer<java.lang.Long> transform)
                                                       throws AnzoException,
                                                              java.sql.SQLException
Runs the selectAclItems prepared statement. SELECT ID AS ID FROM ACIS WHERE ACLID = ? AND HEND IS NULL;

Parameters:
sqlCache - factory and cache of PreparedStatments
aclId - template parameter
transform - org.openanzo.jdbc.utils.Transformer used to transform results into java objects
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

prepareSelectAclItems

public static void prepareSelectAclItems(java.sql.PreparedStatement ps,
                                         long aclId)
                                  throws java.sql.SQLException
Sets the input parameters for the selectAclItems prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
aclId - template parameter
Throws:
java.sql.SQLException

selectNamedGraphsUseAcl

public static ClosableIterator<java.lang.Long> selectNamedGraphsUseAcl(PreparedStatementCache sqlCache,
                                                                       long aclId)
                                                                throws AnzoException,
                                                                       java.sql.SQLException
Runs the selectNamedGraphsUseAcl prepared statement with the default transformer. SELECT NG.ID FROM NAMEDGRAPHS NG WHERE NG.ACLID = ? AND NG.HEND IS NULL;

Parameters:
sqlCache - factory and cache of PreparedStatments
aclId - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

selectNamedGraphsUseAcl

public static ClosableIterator<java.lang.Long> selectNamedGraphsUseAcl(PreparedStatementCache sqlCache,
                                                                       long aclId,
                                                                       Transformer<java.lang.Long> transform)
                                                                throws AnzoException,
                                                                       java.sql.SQLException
Runs the selectNamedGraphsUseAcl prepared statement. SELECT NG.ID FROM NAMEDGRAPHS NG WHERE NG.ACLID = ? AND NG.HEND IS NULL;

Parameters:
sqlCache - factory and cache of PreparedStatments
aclId - template parameter
transform - org.openanzo.jdbc.utils.Transformer used to transform results into java objects
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

prepareSelectNamedGraphsUseAcl

public static void prepareSelectNamedGraphsUseAcl(java.sql.PreparedStatement ps,
                                                  long aclId)
                                           throws java.sql.SQLException
Sets the input parameters for the selectNamedGraphsUseAcl prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
aclId - template parameter
Throws:
java.sql.SQLException

getRoleAci

public static java.lang.Long getRoleAci(PreparedStatementCache sqlCache,
                                        AclRdbWrapper.GetRoleAciParams params)
                                 throws AnzoException,
                                        java.sql.SQLException
Runs the getRoleAci prepared statement. SELECT ACIS.ID AS ID FROM ACIS WHERE ACIS.ACLID = ? AND ACIS.ROLEID = ? AND ACIS.HEND IS NULL;

Parameters:
sqlCache - factory and cache of PreparedStatments
params - GetRoleAciParams input Interface
Returns:
Long containing the results of the SQL operation
Throws:
AnzoException
java.sql.SQLException

getRoleAci

public static java.lang.Long getRoleAci(PreparedStatementCache sqlCache,
                                        long aclId,
                                        long roleId)
                                 throws AnzoException,
                                        java.sql.SQLException
Runs the getRoleAci prepared statement. SELECT ACIS.ID AS ID FROM ACIS WHERE ACIS.ACLID = ? AND ACIS.ROLEID = ? AND ACIS.HEND IS NULL;

Parameters:
sqlCache - factory and cache of PreparedStatments
aclId - template parameter
roleId - template parameter
Returns:
Long
Throws:
AnzoException
java.sql.SQLException

prepareGetRoleAci

public static void prepareGetRoleAci(java.sql.PreparedStatement ps,
                                     long aclId,
                                     long roleId)
                              throws java.sql.SQLException
Sets the input parameters for the getRoleAci prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
aclId - template parameter
roleId - template parameter
Throws:
java.sql.SQLException

selectUserHasAccess

public static AclRdbWrapper.SelectUserHasAccessResult selectUserHasAccess(PreparedStatementCache sqlCache,
                                                                          AclRdbWrapper.SelectUserHasAccessParams params)
                                                                   throws AnzoException,
                                                                          java.sql.SQLException
Runs the selectUserHasAccess prepared statement. SELECT SUM(ACIS.CANREAD) AS CANREAD, SUM(ACIS.CANADD) AS CANADD, SUM(ACIS.CANREMOVE) AS CANREMOVE, SUM(ACIS.CANINSERTNAMEDGRAPH) AS CANINSERTNAMEDGRAPH, SUM(ACIS.CANREMOVENAMEDGRAPH) AS CANREMOVENAMEDGRAPH, SUM(ACIS.CANCHANGENAMEDGRAPHACL) AS CANCHANGENAMEDGRAPHACL FROM ACIS, USERSROLES UR WHERE ACIS.ACLID = ? AND ACIS.ROLEID = UR.ROLEID AND UR.USERID = ? AND UR.HEND IS NULL AND ACIS.HEND IS NULL ;

Parameters:
sqlCache - factory and cache of PreparedStatments
params - SelectUserHasAccessParams input Interface
Returns:
SelectUserHasAccessResult containing the results of the SQL operation
Throws:
AnzoException
java.sql.SQLException

selectUserHasAccess

public static AclRdbWrapper.SelectUserHasAccessResult selectUserHasAccess(PreparedStatementCache sqlCache,
                                                                          long aclId,
                                                                          long userId)
                                                                   throws AnzoException,
                                                                          java.sql.SQLException
Runs the selectUserHasAccess prepared statement. SELECT SUM(ACIS.CANREAD) AS CANREAD, SUM(ACIS.CANADD) AS CANADD, SUM(ACIS.CANREMOVE) AS CANREMOVE, SUM(ACIS.CANINSERTNAMEDGRAPH) AS CANINSERTNAMEDGRAPH, SUM(ACIS.CANREMOVENAMEDGRAPH) AS CANREMOVENAMEDGRAPH, SUM(ACIS.CANCHANGENAMEDGRAPHACL) AS CANCHANGENAMEDGRAPHACL FROM ACIS, USERSROLES UR WHERE ACIS.ACLID = ? AND ACIS.ROLEID = UR.ROLEID AND UR.USERID = ? AND UR.HEND IS NULL AND ACIS.HEND IS NULL ;

Parameters:
sqlCache - factory and cache of PreparedStatments
aclId - template parameter
userId - template parameter
Returns:
SelectUserHasAccessResult containing the results of the SQL operation
Throws:
AnzoException
java.sql.SQLException

selectUserHasAccess

public static AclRdbWrapper.SelectUserHasAccessResult selectUserHasAccess(PreparedStatementCache sqlCache,
                                                                          long aclId,
                                                                          long userId,
                                                                          AclRdbWrapper.SelectUserHasAccessResult result)
                                                                   throws AnzoException,
                                                                          java.sql.SQLException
Runs the selectUserHasAccess prepared statement. SELECT SUM(ACIS.CANREAD) AS CANREAD, SUM(ACIS.CANADD) AS CANADD, SUM(ACIS.CANREMOVE) AS CANREMOVE, SUM(ACIS.CANINSERTNAMEDGRAPH) AS CANINSERTNAMEDGRAPH, SUM(ACIS.CANREMOVENAMEDGRAPH) AS CANREMOVENAMEDGRAPH, SUM(ACIS.CANCHANGENAMEDGRAPHACL) AS CANCHANGENAMEDGRAPHACL FROM ACIS, USERSROLES UR WHERE ACIS.ACLID = ? AND ACIS.ROLEID = UR.ROLEID AND UR.USERID = ? AND UR.HEND IS NULL AND ACIS.HEND IS NULL ;

Parameters:
sqlCache - factory and cache of PreparedStatments
aclId - template parameter
userId - template parameter
result - SelectUserHasAccessResult result object
Returns:
SelectUserHasAccessResult
Throws:
AnzoException
java.sql.SQLException

prepareSelectUserHasAccess

public static void prepareSelectUserHasAccess(java.sql.PreparedStatement ps,
                                              long aclId,
                                              long userId)
                                       throws java.sql.SQLException
Sets the input parameters for the selectUserHasAccess prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
aclId - template parameter
userId - template parameter
Throws:
java.sql.SQLException

selectUsersForNamedGraphs

public static ClosableIterator<java.lang.String> selectUsersForNamedGraphs(PreparedStatementCache sqlCache,
                                                                           long metaid,
                                                                           java.lang.String tableNamePrefix)
                                                                    throws AnzoException,
                                                                           java.sql.SQLException
Runs the selectUsersForNamedGraphs prepared statement with the default transformer. WITH LT (COMMITED) AS ( SELECT MAX(COMMITED) FROM TRANSACTIONTIMES ) SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR,LT WHERE UR.HSTART <= LT.COMMITED AND (UR.HEND IS NULL OR UR.HEND > LT.COMMITED) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= LT.COMMITED AND (NG.HEND IS NULL OR NG.HEND > LT.COMMITED) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= LT.COMMITED AND (ACIS.HEND IS NULL OR ACIS.HEND > LT.COMMITED) AND ACIS.CANREAD=1 ) );

Parameters:
sqlCache - factory and cache of PreparedStatments
metaid - template parameter
tableNamePrefix - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

selectUsersForNamedGraphs

public static ClosableIterator<java.lang.String> selectUsersForNamedGraphs(PreparedStatementCache sqlCache,
                                                                           long metaid,
                                                                           java.lang.String tableNamePrefix,
                                                                           Transformer<java.lang.String> transform)
                                                                    throws AnzoException,
                                                                           java.sql.SQLException
Runs the selectUsersForNamedGraphs prepared statement. WITH LT (COMMITED) AS ( SELECT MAX(COMMITED) FROM TRANSACTIONTIMES ) SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR,LT WHERE UR.HSTART <= LT.COMMITED AND (UR.HEND IS NULL OR UR.HEND > LT.COMMITED) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= LT.COMMITED AND (NG.HEND IS NULL OR NG.HEND > LT.COMMITED) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= LT.COMMITED AND (ACIS.HEND IS NULL OR ACIS.HEND > LT.COMMITED) AND ACIS.CANREAD=1 ) );

Parameters:
sqlCache - factory and cache of PreparedStatments
metaid - template parameter
tableNamePrefix - template parameter
transform - org.openanzo.jdbc.utils.Transformer used to transform results into java objects
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

prepareSelectUsersForNamedGraphs

public static void prepareSelectUsersForNamedGraphs(java.sql.PreparedStatement ps,
                                                    long metaid)
                                             throws java.sql.SQLException
Sets the input parameters for the selectUsersForNamedGraphs prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
metaid - template parameter
Throws:
java.sql.SQLException

selectUsersForNamedGraphsNoWith

public static ClosableIterator<java.lang.String> selectUsersForNamedGraphsNoWith(PreparedStatementCache sqlCache,
                                                                                 AclRdbWrapper.SelectUsersForNamedGraphsNoWithParams params,
                                                                                 java.lang.String tableNamePrefix)
                                                                          throws AnzoException,
                                                                                 java.sql.SQLException
Runs the selectUsersForNamedGraphsNoWith prepared statement. SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR WHERE UR.HSTART <= ? AND (UR.HEND IS NULL OR UR.HEND > ?) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 ) );

Parameters:
sqlCache - factory and cache of PreparedStatments
params - SelectUsersForNamedGraphsNoWithParams input Interface
tableNamePrefix - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator containing the results of the SQL operation
Throws:
AnzoException
java.sql.SQLException

selectUsersForNamedGraphsNoWith

public static ClosableIterator<java.lang.String> selectUsersForNamedGraphsNoWith(PreparedStatementCache sqlCache,
                                                                                 java.lang.Long now1,
                                                                                 java.lang.Long now2,
                                                                                 long metaid,
                                                                                 java.lang.Long now3,
                                                                                 java.lang.Long now4,
                                                                                 java.lang.Long now5,
                                                                                 java.lang.Long now6,
                                                                                 java.lang.String tableNamePrefix)
                                                                          throws AnzoException,
                                                                                 java.sql.SQLException
Runs the selectUsersForNamedGraphsNoWith prepared statement with the default transformer. SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR WHERE UR.HSTART <= ? AND (UR.HEND IS NULL OR UR.HEND > ?) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 ) );

Parameters:
sqlCache - factory and cache of PreparedStatments
now1 - template parameter
now2 - template parameter
metaid - template parameter
now3 - template parameter
now4 - template parameter
now5 - template parameter
now6 - template parameter
tableNamePrefix - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

selectUsersForNamedGraphsNoWith

public static ClosableIterator<java.lang.String> selectUsersForNamedGraphsNoWith(PreparedStatementCache sqlCache,
                                                                                 java.lang.Long now1,
                                                                                 java.lang.Long now2,
                                                                                 long metaid,
                                                                                 java.lang.Long now3,
                                                                                 java.lang.Long now4,
                                                                                 java.lang.Long now5,
                                                                                 java.lang.Long now6,
                                                                                 java.lang.String tableNamePrefix,
                                                                                 Transformer<java.lang.String> transform)
                                                                          throws AnzoException,
                                                                                 java.sql.SQLException
Runs the selectUsersForNamedGraphsNoWith prepared statement. SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT UR.USERID FROM USERSROLES UR WHERE UR.HSTART <= ? AND (UR.HEND IS NULL OR UR.HEND > ?) AND UR.ROLEID IN(SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.METAID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 ) );

Parameters:
sqlCache - factory and cache of PreparedStatments
now1 - template parameter
now2 - template parameter
metaid - template parameter
now3 - template parameter
now4 - template parameter
now5 - template parameter
now6 - template parameter
tableNamePrefix - template parameter
transform - org.openanzo.jdbc.utils.Transformer used to transform results into java objects
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

prepareSelectUsersForNamedGraphsNoWith

public static void prepareSelectUsersForNamedGraphsNoWith(java.sql.PreparedStatement ps,
                                                          java.lang.Long now1,
                                                          java.lang.Long now2,
                                                          long metaid,
                                                          java.lang.Long now3,
                                                          java.lang.Long now4,
                                                          java.lang.Long now5,
                                                          java.lang.Long now6)
                                                   throws java.sql.SQLException
Sets the input parameters for the selectUsersForNamedGraphsNoWith prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
now1 - template parameter
now2 - template parameter
metaid - template parameter
now3 - template parameter
now4 - template parameter
now5 - template parameter
now6 - template parameter
Throws:
java.sql.SQLException

selectRolesForNamedGraph

public static ClosableIterator<java.lang.String> selectRolesForNamedGraph(PreparedStatementCache sqlCache,
                                                                          long metaid,
                                                                          java.lang.String tableNamePrefix)
                                                                   throws AnzoException,
                                                                          java.sql.SQLException
Runs the selectRolesForNamedGraph prepared statement with the default transformer. WITH LT (COMMITED) AS ( SELECT MAX(COMMITED) FROM TRANSACTIONTIMES ) SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT DISTINCT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS,LT WHERE NG.ID = ? AND NG.HSTART <= LT.COMMITED AND (NG.HEND IS NULL OR NG.HEND > LT.COMMITED) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= LT.COMMITED AND (ACIS.HEND IS NULL OR ACIS.HEND > LT.COMMITED) AND ACIS.CANREAD=1 );

Parameters:
sqlCache - factory and cache of PreparedStatments
metaid - template parameter
tableNamePrefix - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

selectRolesForNamedGraph

public static ClosableIterator<java.lang.String> selectRolesForNamedGraph(PreparedStatementCache sqlCache,
                                                                          long metaid,
                                                                          java.lang.String tableNamePrefix,
                                                                          Transformer<java.lang.String> transform)
                                                                   throws AnzoException,
                                                                          java.sql.SQLException
Runs the selectRolesForNamedGraph prepared statement. WITH LT (COMMITED) AS ( SELECT MAX(COMMITED) FROM TRANSACTIONTIMES ) SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT DISTINCT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS,LT WHERE NG.ID = ? AND NG.HSTART <= LT.COMMITED AND (NG.HEND IS NULL OR NG.HEND > LT.COMMITED) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= LT.COMMITED AND (ACIS.HEND IS NULL OR ACIS.HEND > LT.COMMITED) AND ACIS.CANREAD=1 );

Parameters:
sqlCache - factory and cache of PreparedStatments
metaid - template parameter
tableNamePrefix - template parameter
transform - org.openanzo.jdbc.utils.Transformer used to transform results into java objects
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

prepareSelectRolesForNamedGraph

public static void prepareSelectRolesForNamedGraph(java.sql.PreparedStatement ps,
                                                   long metaid)
                                            throws java.sql.SQLException
Sets the input parameters for the selectRolesForNamedGraph prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
metaid - template parameter
Throws:
java.sql.SQLException

selectRolesForNamedGraphNoWith

public static ClosableIterator<java.lang.String> selectRolesForNamedGraphNoWith(PreparedStatementCache sqlCache,
                                                                                AclRdbWrapper.SelectRolesForNamedGraphNoWithParams params,
                                                                                java.lang.String tableNamePrefix)
                                                                         throws AnzoException,
                                                                                java.sql.SQLException
Runs the selectRolesForNamedGraphNoWith prepared statement. SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.ID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 );

Parameters:
sqlCache - factory and cache of PreparedStatments
params - SelectRolesForNamedGraphNoWithParams input Interface
tableNamePrefix - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator containing the results of the SQL operation
Throws:
AnzoException
java.sql.SQLException

selectRolesForNamedGraphNoWith

public static ClosableIterator<java.lang.String> selectRolesForNamedGraphNoWith(PreparedStatementCache sqlCache,
                                                                                java.lang.Long now1,
                                                                                java.lang.Long now2,
                                                                                long metaid,
                                                                                java.lang.Long now3,
                                                                                java.lang.Long now4,
                                                                                java.lang.String tableNamePrefix)
                                                                         throws AnzoException,
                                                                                java.sql.SQLException
Runs the selectRolesForNamedGraphNoWith prepared statement with the default transformer. SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.ID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 );

Parameters:
sqlCache - factory and cache of PreparedStatments
now1 - template parameter
now2 - template parameter
metaid - template parameter
now3 - template parameter
now4 - template parameter
tableNamePrefix - template parameter
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

selectRolesForNamedGraphNoWith

public static ClosableIterator<java.lang.String> selectRolesForNamedGraphNoWith(PreparedStatementCache sqlCache,
                                                                                java.lang.Long now1,
                                                                                java.lang.Long now2,
                                                                                long metaid,
                                                                                java.lang.Long now3,
                                                                                java.lang.Long now4,
                                                                                java.lang.String tableNamePrefix,
                                                                                Transformer<java.lang.String> transform)
                                                                         throws AnzoException,
                                                                                java.sql.SQLException
Runs the selectRolesForNamedGraphNoWith prepared statement. SELECT ${a}_U.VALUE FROM ${a}_U WHERE ${a}_U.ID IN( SELECT ACIS.ROLEID FROM NAMEDGRAPHS NG,ACIS ACIS WHERE NG.ID = ? AND NG.HSTART <= ? AND (NG.HEND IS NULL OR NG.HEND > ?) AND NG.ACLID=ACIS.ACLID AND ACIS.HSTART <= ? AND (ACIS.HEND IS NULL OR ACIS.HEND > ?) AND ACIS.CANREAD=1 );

Parameters:
sqlCache - factory and cache of PreparedStatments
now1 - template parameter
now2 - template parameter
metaid - template parameter
now3 - template parameter
now4 - template parameter
tableNamePrefix - template parameter
transform - org.openanzo.jdbc.utils.Transformer used to transform results into java objects
Returns:
org.openanzo.jdbc.utils.ClosableIterator
Throws:
AnzoException
java.sql.SQLException

prepareSelectRolesForNamedGraphNoWith

public static void prepareSelectRolesForNamedGraphNoWith(java.sql.PreparedStatement ps,
                                                         java.lang.Long now1,
                                                         java.lang.Long now2,
                                                         long metaid,
                                                         java.lang.Long now3,
                                                         java.lang.Long now4)
                                                  throws java.sql.SQLException
Sets the input parameters for the selectRolesForNamedGraphNoWith prepared statement.

Parameters:
ps - PreparedStatement to whose parameters are set
now1 - template parameter
now2 - template parameter
metaid - template parameter
now3 - template parameter
now4 - template parameter
Throws:
java.sql.SQLException


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.