Package org.apache.commons.collections.map

Examples of org.apache.commons.collections.map.ListOrderedMap


        return previousMap;
    }

    private ListOrderedMap getChildEntries(JCRNodeWrapper node, JCRSessionWrapper session) throws RepositoryException {
        NodeIterator ni1 = node.getNodes();
        ListOrderedMap childEntries = new ListOrderedMap();
        while (ni1.hasNext()) {
            Node child = (Node) ni1.next();
            try {
                if (child.isNodeType(Constants.NT_VERSIONEDCHILD)) {
                    VersionHistory vh = (VersionHistory) node.getSession().getNodeByIdentifier(child.getProperty("jcr:childVersionHistory").getValue().getString());
                    String uuid = vh.getRootVersion().getFrozenNode().getProperty(Constants.JCR_FROZENUUID).getValue().getString();
                    childEntries.put(uuid, child.getName());
                } else if (child.isNodeType(Constants.NT_FROZENNODE)) {
                    String uuid = child.getProperty(Constants.JCR_FROZENUUID).getValue().getString();
                    childEntries.put(uuid, child.getName());
                } else {
                    session.getNodeByUUID(child.getIdentifier());
                    childEntries.put(child.getIdentifier(), child.getName());
                }
            } catch (ItemNotFoundException e) {
                // item does not exist in this workspace
            }
        }
View Full Code Here


    /**
    * Remove the stamp from stack (when resuming)
    */
    private static void popTransactionStartStamp() {
        ListOrderedMap map = (ListOrderedMap) suspendedTxStartStamps.get();
        if (map.size() > 0) {
            transactionStartStamp.set((Timestamp) map.remove(map.lastKey()));
        } else {
            Debug.logError("Error in transaction handling - no saved start stamp found - using NOW.", module);
            transactionStartStamp.set(UtilDateTime.nowTimestamp());
        }
    }
View Full Code Here

   * @param m
   */
  @SuppressWarnings("static-access")
  public static void  populate(Object bean,HttpRequest request, Map<?, ?> m)
  {
    ListOrderedMap orderedMap = new ListOrderedMap();
    Map<?, ?> map=request.getParameterMap();
    orderedMap.putAll(map);
    PropertyUtils propertyUtils = new PropertyUtils();
    @SuppressWarnings("unchecked")
    List<String> list=orderedMap.asList();
    for (String string : list)
    {
      String[] name = StringUtils.split(string, ".");
     
      if (name.length==1)
View Full Code Here

    private class Entries {

        private final ListOrderedMap principalNamesToEntries;

        private Entries(NodeImpl node, Collection principalNames) throws RepositoryException {
            principalNamesToEntries = new ListOrderedMap();
            for (Iterator it = principalNames.iterator(); it.hasNext();) {
                principalNamesToEntries.put(it.next(), new ArrayList());
            }
            collectEntries(node);
        }
View Full Code Here

     * @param table The table
     * @return The parameters
     */
    public Map getParametersFor(Table table)
    {
        ListOrderedMap result       = new ListOrderedMap();
        Map            globalParams = (Map)_parametersPerTable.get(null);
        Map            tableParams  = (Map)_parametersPerTable.get(table);

        if (globalParams != null)
        {
            result.putAll(globalParams);
        }
        if (tableParams != null)
        {
            result.putAll(tableParams);
        }
        return result;
    }
View Full Code Here

        Map params = (Map)_parametersPerTable.get(table);

        if (params == null)
        {
            // we're using a list orderered map to retain the order
            params = new ListOrderedMap();
            _parametersPerTable.put(table, params);
        }
        params.put(paramName, paramValue);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    protected Collection readForeignKeys(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
    {
        Map       fks    = new ListOrderedMap();
        ResultSet fkData = null;

        try
        {
            if (getPlatform().isDelimitedIdentifierModeOn())
          {
            // Jaybird has a problem when delimited identifiers are used as
            // it is not able to find the foreign key info for the table
            // So we have to filter manually below
              fkData = metaData.getForeignKeys(getDefaultTablePattern());
              while (fkData.next())
              {
                  Map values = readColumns(fkData, getColumnsForFK());
 
                    if (tableName.equals(values.get("FKTABLE_NAME")))
                    {
                      readForeignKey(metaData, values, fks);
                    }
              }
          }
            else
            {
              fkData = metaData.getForeignKeys(tableName);
              while (fkData.next())
              {
                  Map values = readColumns(fkData, getColumnsForFK());
 
                  readForeignKey(metaData, values, fks);
              }
            }
        }
        finally
        {
            if (fkData != null)
            {
                fkData.close();
            }
        }
        return fks.values();
    }
View Full Code Here

     */
    protected Collection readIndices(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
    {
        // Jaybird is not able to read indices when delimited identifiers are turned on,
        // so we gather the data manually using Firebird's system tables
        Map          indices = new ListOrderedMap();
        StringBuffer query   = new StringBuffer();
       
        query.append("SELECT a.RDB$INDEX_NAME INDEX_NAME, b.RDB$RELATION_NAME TABLE_NAME, b.RDB$UNIQUE_FLAG NON_UNIQUE,");
        query.append(" a.RDB$FIELD_POSITION ORDINAL_POSITION, a.RDB$FIELD_NAME COLUMN_NAME, 3 INDEX_TYPE");
        query.append(" FROM RDB$INDEX_SEGMENTS a, RDB$INDICES b WHERE a.RDB$INDEX_NAME=b.RDB$INDEX_NAME AND b.RDB$RELATION_NAME = ?");

        PreparedStatement stmt      = getConnection().prepareStatement(query.toString());
        ResultSet         indexData = null;

        stmt.setString(1, getPlatform().isDelimitedIdentifierModeOn() ? tableName : tableName.toUpperCase());

        try
        {
          indexData = stmt.executeQuery();

            while (indexData.next())
            {
                Map values = readColumns(indexData, getColumnsForIndex());

                // we have to reverse the meaning of the unique flag
                values.put("NON_UNIQUE", Boolean.FALSE.equals(values.get("NON_UNIQUE")) ? Boolean.TRUE : Boolean.FALSE);
                // and trim the names
                values.put("INDEX_NAME"((String)values.get("INDEX_NAME")).trim());
                values.put("TABLE_NAME"((String)values.get("TABLE_NAME")).trim());
                values.put("COLUMN_NAME", ((String)values.get("COLUMN_NAME")).trim());
                readIndex(metaData, values, indices);
            }
        }
        finally
        {
            if (indexData != null)
            {
                indexData.close();
            }
        }
        return indices.values();
    }
View Full Code Here

     * @param tableName The name of the table from which to retrieve FK information
     * @return The foreign keys
     */
    protected Collection readForeignKeys(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
    {
        Map       fks    = new ListOrderedMap();
        ResultSet fkData = null;

        try
        {
            fkData = metaData.getForeignKeys(tableName);

            while (fkData.next())
            {
                Map values = readColumns(fkData, getColumnsForFK());

                readForeignKey(metaData, values, fks);
            }
        }
        finally
        {
            if (fkData != null)
            {
                fkData.close();
            }
        }
        return fks.values();
    }
View Full Code Here

     * @param tableName The name of the table
     * @return The list of indices
     */
    protected Collection readIndices(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
    {
        Map       indices   = new ListOrderedMap();
        ResultSet indexData = null;

        try
        {
            indexData = metaData.getIndices(tableName, false, false);

            while (indexData.next())
            {
                Map values = readColumns(indexData, getColumnsForIndex());

                readIndex(metaData, values, indices);
            }
        }
        finally
        {
            if (indexData != null)
            {
                indexData.close();
            }
        }
        return indices.values();
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.map.ListOrderedMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.