当前位置: 首页>>代码示例>>Java>>正文


Java IntValueHashMap类代码示例

本文整理汇总了Java中org.hsqldb.lib.IntValueHashMap的典型用法代码示例。如果您正苦于以下问题:Java IntValueHashMap类的具体用法?Java IntValueHashMap怎么用?Java IntValueHashMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IntValueHashMap类属于org.hsqldb.lib包,在下文中一共展示了IntValueHashMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JDBCCallableStatement

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Constructs a new JDBCCallableStatement with the specified connection and
 * result type.
 *
 * @param  c the connection on which this statement will execute
 * @param sql the SQL statement this object represents
 * @param resultSetType the type of result this statement will produce
 * @throws HsqlException if the statement is not accepted by the database
 * @throws SQLException if preprocessing by driver fails
 */
public JDBCCallableStatement(
        JDBCConnection c, String sql, int resultSetType,
        int resultSetConcurrency,
        int resultSetHoldability) throws HsqlException, SQLException {

    super(c, sql, resultSetType, resultSetConcurrency,
          resultSetHoldability, ResultConstants.RETURN_NO_GENERATED_KEYS,
          null, null);

    String[] names;
    String   name;

    // outRegistrationMap = new IntKeyIntValueHashMap();
    parameterNameMap = new IntValueHashMap();

    if (parameterMetaData != null) {
        names = parameterMetaData.columnLabels;

        for (int i = 0; i < names.length; i++) {
            name = names[i];

            // PRE:  should never happen in practice
            if (name == null || name.length() == 0) {
                continue;    // throw?
            }
            parameterNameMap.put(name, i);
        }
    }
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:40,代码来源:JDBCCallableStatement.java

示例2: setReferenceableColumns

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
void setReferenceableColumns() {

        accessibleColumns = new boolean[indexLimitVisible];

        IntValueHashMap aliases = new IntValueHashMap();

        for (int i = 0; i < indexLimitVisible; i++) {
            Expression expression = exprColumns[i];
            String     alias      = expression.getAlias();

            if (alias.length() == 0) {
                SimpleName name = HsqlNameManager.getAutoColumnName(i);

                expression.setAlias(name);

                continue;
            }

            int index = aliases.get(alias, -1);

            if (index == -1) {
                aliases.put(alias, i);

                accessibleColumns[i] = true;
            } else {
                accessibleColumns[index] = false;
            }
        }
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:30,代码来源:QuerySpecification.java

示例3: JDBCCallableStatement

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Constructs a new JDBCCallableStatement with the specified connection and
 * result type.
 *
 * @param  c the connection on which this statement will execute
 * @param sql the SQL statement this object represents
 * @param resultSetType the type of result this statement will produce
 * @throws HsqlException if the statement is not accepted by the database
 * @throws SQLException if preprocessing by driver fails
 */
public JDBCCallableStatement(
        JDBCConnection c, String sql, int resultSetType,
        int resultSetConcurrency,
        int resultSetHoldability) throws HsqlException, SQLException {

    super(c, sql, resultSetType, JDBCResultSet.CONCUR_READ_ONLY,
          JDBCResultSet.HOLD_CURSORS_OVER_COMMIT,
          ResultConstants.RETURN_NO_GENERATED_KEYS, null, null);

    session = c.sessionProxy;

    String[] names;
    String   name;

    // outRegistrationMap = new IntKeyIntValueHashMap();
    parameterNameMap = new IntValueHashMap();

    if (parameterMetaData != null) {
        names = parameterMetaData.columnLabels;

        for (int i = 0; i < names.length; i++) {
            name = names[i];

            // PRE:  should never happen in practice
            if (name == null || name.length() == 0) {
                continue;    // throw?
            }
            parameterNameMap.put(name, i);
        }
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:42,代码来源:JDBCCallableStatement.java

示例4: jdbcCallableStatement

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Constructs a new jdbcCallableStatement with the specified connection and
 * result type.
 *
 * @param  c the connection on which this statement will execute
 * @param sql the SQL statement this object represents
 * @param type the type of result this statement will produce
 * @throws HsqlException if the statement is not accepted by the database
 * @throws SQLException if preprocessing by driver fails
 */
public jdbcCallableStatement(jdbcConnection c, String sql,
                             int type)
                             throws HsqlException, SQLException {

    super(c, sql, type);

    String[] names;
    String   name;

    // outRegistrationMap = new IntKeyIntValueHashMap();
    parameterNameMap = new IntValueHashMap();

    if (pmdDescriptor != null && pmdDescriptor.metaData != null) {
        names = pmdDescriptor.metaData.colNames;

        for (int i = 0; i < names.length; i++) {
            name = names[i];

            // PRE:  should never happen in practice
            if (name == null || name.length() == 0) {
                continue;    // throw?
            }

            parameterNameMap.put(name, i);
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:38,代码来源:jdbcCallableStatement.java

示例5: User

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Constructor, with a argument reference to the PUBLIC User Object which
 * is null if this is the SYS or PUBLIC user.
 */
User(String name, String password, boolean admin, User pub) {

    rightsMap = new IntValueHashMap();
    sName     = name;

    setPassword(password);

    isAdministrator = admin;
    isSys           = name.equals(UserManager.SYS_USER_NAME);
    isPublic        = name.equals(UserManager.PUBLIC_USER_NAME);
    uPublic         = pub;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:User.java

示例6: CompiledStatementManager

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Constructs a new instance of <code>CompiledStatementManager</code>.
 *
 * @param database the Database instance for which this object is to
 *      manage compiled statement objects.
 */
CompiledStatementManager(Database database) {

    this.database = database;
    sqlMap        = new IntValueHashMap();
    sqlLookup     = new IntKeyHashMap();
    csidMap       = new IntKeyHashMap();
    sessionMap    = new IntKeyHashMap();
    useMap        = new IntKeyIntValueHashMap();
    next_cs_id    = 0;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:CompiledStatementManager.java

示例7: jdbcCallableStatement

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Constructs a new jdbcCallableStatement with the specified connection and
 * result type.
 *
 * @param  c the connection on which this statement will execute
 * @param sql the SQL statement this object represents
 * @param type the type of result this statement will produce
 * @throws HsqlException if the statement is not accepted by the database
 * @throws SQLException if preprocessing by driver fails
 */
public jdbcCallableStatement(jdbcConnection c, String sql,
                             int type) throws HsqlException, SQLException {

    super(c, sql, type);

    String[] names;
    String   name;

    // outRegistrationMap = new IntKeyIntValueHashMap();
    parameterNameMap = new IntValueHashMap();

    if (pmdDescriptor != null && pmdDescriptor.metaData != null) {
        names = pmdDescriptor.metaData.colNames;

        for (int i = 0; i < names.length; i++) {
            name = names[i];

            // PRE:  should never happen in practice
            if (name == null || name.length() == 0) {
                continue;    // throw?
            }

            parameterNameMap.put(name, i);
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:jdbcCallableStatement.java

示例8: Grantee

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Constructor, with a argument reference to the PUBLIC User Object which
 * is null if this is the SYS or PUBLIC user.
 *
 * The dependency upon a GranteeManager is undesirable.  Hopefully we
 * can get rid of this dependency with an IOC or Listener re-design.
 */
Grantee(String name, Grantee inGrantee,
        GranteeManager man) throws HsqlException {

    rightsMap      = new IntValueHashMap();
    granteeName    = name;
    granteeManager = man;
    pubGrantee     = inGrantee;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:Grantee.java

示例9: getGrantedClassNames

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Retrieves the distinct set of Java <code>Class</code> FQNs
 * for which this <code>User</code> object has been
 * granted <code>ALL</code> (the Class execution privilege). <p>
 * @param andToPublic if <code>true</code>, then the set includes the
 *        names of classes accessible to this <code>User</code> object
 *        through grants to its Roles + <code>PUBLIC</code>
 *        <code>User</code> object attribute, else only role grants
 *        + direct grants are included.
 * @return the distinct set of Java Class FQNs for which this
 *        this <code>User</code> object has been granted
 *        <code>ALL</code>.
 */
HashSet getGrantedClassNames(boolean andToPublic) throws HsqlException {

    IntValueHashMap rights;
    Object          key;
    int             right;
    Iterator        i;

    rights = rightsMap;

    HashSet out = getGrantedClassNamesDirect();

    if (andToPublic && pubGrantee != null) {
        rights = pubGrantee.rightsMap;
        i      = rights.keySet().iterator();

        while (i.hasNext()) {
            key = i.next();

            if (key instanceof String) {
                right = rights.get(key, 0);

                if (right == GranteeManager.ALL) {
                    out.add(key);
                }
            }
        }
    }

    Iterator it = getAllRoles().iterator();

    while (it.hasNext()) {
        out.addAll(
            ((Grantee) granteeManager.getRole(
                (String) it.next())).getGrantedClassNamesDirect());
    }

    return out;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:52,代码来源:Grantee.java

示例10: getStatementID

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Retrieves the registered compiled statement identifier associated with
 * the specified SQL String, or a value less than zero, if no such
 * statement has been registered.
 *
 * @param schema the schema id
 * @param sql the SQL String
 * @return the compiled statement identifier associated with the
 *      specified SQL String
 */
private int getStatementID(HsqlName schema, String sql) {

    IntValueHashMap sqlMap =
        (IntValueHashMap) schemaMap.get(schema.hashCode());

    if (sqlMap == null) {
        return -1;
    }

    return sqlMap.get(sql, -1);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:CompiledStatementManager.java

示例11: getGrantedClassNamesDirect

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Retrieves the distinct set of Java <code>Class</code> FQNs
 * for which this <code>User</code> object has directly been
 * granted <code>ALL</code> (the Class execution privilege).
 *
 * Does NOT check nested the pubGrantee nor nested roles.
 * @return the distinct set of Java Class FQNs for which this
 *        this <code>User</code> object has been granted
 *        <code>ALL</code>.
 *
 */
HashSet getGrantedClassNamesDirect() throws HsqlException {

    IntValueHashMap rights;
    HashSet         out;
    Object          key;
    int             right;
    Iterator        i;

    rights = rightsMap;
    out    = new HashSet();
    i      = rightsMap.keySet().iterator();

    while (i.hasNext()) {
        key = i.next();

        if (key instanceof String) {
            right = rights.get(key, 0);

            if (right == GranteeManager.ALL) {
                out.add(key);
            }
        }
    }

    return out;
}
 
开发者ID:danielbejaranogonzalez,项目名称:Mobile-Network-LTE,代码行数:38,代码来源:Grantee.java

示例12: addRightsStatements

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Generates the GRANT statements for users.
 *
 * When views is true, generates rights for views only. Otherwise generates
 * rights for tables and classes.
 *
 * Does not generate script for:
 *
 * grant on builtin classes to public
 * grant select on system tables
 *
 */
private static void addRightsStatements(Database dDatabase, Result r) {

    StringBuffer   a;
    HashMappedList uv = dDatabase.getUserManager().getUsers();
    Iterator       it = uv.values().iterator();

    for (; it.hasNext(); ) {
        User   u    = (User) it.next();
        String name = u.getName();

        if (!name.equals(Token.T_PUBLIC)) {
            addRow(r, u.getCreateUserDDL());
        }

        IntValueHashMap rights = u.getRights();

        if (rights == null) {
            continue;
        }

        Iterator e = rights.keySet().iterator();

        while (e.hasNext()) {
            Object object = e.next();
            int    right  = rights.get(object, 0);

            a = new StringBuffer(64);

            a.append(Token.T_GRANT).append(' ');
            a.append(UserManager.getRight(right));
            a.append(' ').append(Token.T_ON).append(' ');

            if (object instanceof String) {
                if (object.equals("java.lang.Math")
                        || object.equals("org.hsqldb.Library")) {
                    continue;
                }

                a.append("CLASS \"");
                a.append((String) object);
                a.append('\"');
            } else {

                // either table != null or is system table
                Table table =
                    dDatabase.findUserTable(((HsqlName) object).name);

                // assumes all non String objects are table names
                if (table != null) {
                    a.append(((HsqlName) object).statementName);
                } else {
                    continue;
                }
            }

            a.append(' ').append(Token.T_TO).append(' ');
            a.append(u.getName());
            addRow(r, a.toString());
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:74,代码来源:DatabaseScript.java

示例13: freeStatement

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Removes one (or all) of the links between a session and a compiled statement.
 *
 * If the statement is not linked with any other session, it is removed
 * from management.
 *
 * @param csid the compiled statment identifier
 * @param sid the session identifier
 * @param freeAll if true, remove all links to the session
 */
void freeStatement(int csid, int sid, boolean freeAll) {

    if (csid == -1) {

        // statement was never added
        return;
    }

    IntKeyIntValueHashMap scsMap =
        (IntKeyIntValueHashMap) sessionUseMap.get(sid);

    if (scsMap == null) {

        // statement already removed due to invalidation
        return;
    }

    int sessionUseCount = scsMap.get(csid, 0);

    if (sessionUseCount == 0) {

        // statement already removed due to invalidation
    } else if (sessionUseCount == 1 || freeAll) {
        scsMap.remove(csid);

        int usecount = useMap.get(csid, 0);

        if (usecount == 0) {

            // statement already removed due to invalidation
        } else if (usecount == 1) {
            CompiledStatement cs =
                (CompiledStatement) csidMap.remove(csid);

            if (cs != null) {
                int schemaid = cs.schemaHsqlName.hashCode();
                IntValueHashMap sqlMap =
                    (IntValueHashMap) schemaMap.get(schemaid);
                String sql = (String) sqlLookup.remove(csid);

                sqlMap.remove(sql);
            }

            useMap.remove(csid);
        } else {
            useMap.put(csid, usecount - 1);
        }
    } else {
        scsMap.put(csid, sessionUseCount - 1);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:62,代码来源:CompiledStatementManager.java

示例14: getRights

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Retrieves the map object that represents the rights that have been
 * granted on database objects.  <p>
 *
 * The map has keys and values with the following interpretation: <P>
 *
 * <UL>
 * <LI> The keys are generally (but not limited to) objects having
 *      an attribute or value equal to the name of an actual database
 *      object.
 *
 * <LI> Specifically, the keys act as database object identifiers.
 *
 * <LI> The values are always Integer objects, each formed by combining
 *      a set of flags, one for each of the access rights defined in
 *      UserManager: {SELECT, INSERT, UPDATE and DELETE}.
 * </UL>
 */
IntValueHashMap getRights() {

    // necessary to create the script
    return rightsMap;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:User.java

示例15: getRights

import org.hsqldb.lib.IntValueHashMap; //导入依赖的package包/类
/**
 * Retrieves the map object that represents the rights that have been
 * granted on database objects.  <p>
 *
 * The map has keys and values with the following interpretation: <P>
 *
 * <UL>
 * <LI> The keys are generally (but not limited to) objects having
 *      an attribute or value equal to the name of an actual database
 *      object.
 *
 * <LI> Specifically, the keys act as database object identifiers.
 *
 * <LI> The values are always Integer objects, each formed by combining
 *      a set of flags, one for each of the access rights defined in
 *      UserManager: {SELECT, INSERT, UPDATE and DELETE}.
 * </UL>
 */
IntValueHashMap getRights() {
    return grantee.getRights();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:User.java


注:本文中的org.hsqldb.lib.IntValueHashMap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。