Package nexj.core.util

Examples of nexj.core.util.HashHolder


    * @see nexj.core.persistence.PersistenceAdapter#isUnique(nexj.core.persistence.Query, java.util.List)
    */
   public boolean isUnique(Query query, List sourceList)
   {
      int nCount = sourceList.size();
      Set columnSet = new HashHolder(nCount);

      for (int nSource = 0; nSource < nCount; ++nSource)
      {
         Source source = (Source)sourceList.get(nSource);

         if (source instanceof Field)
         {
            addColumns((Field)source, columnSet);
         }
         else
         {
            Query assoc = source.getQuery();

            if (assoc.getParent() == query)
            {
               Index index = (Index)query.getKey(false);

               for (int i = 0, n = index.getIndexColumnCount(); i < n; ++i)
               {
                  columnSet.add(index.getIndexColumn(i).getColumn());
               }
            }
         }
      }

      if (!columnSet.isEmpty())
      {
         Set tableSet = new HashHolder(columnSet.size() >> 2);

         for (Iterator itr = columnSet.iterator(); itr.hasNext();)
         {
            tableSet.add(((Column)itr.next()).getTable());
         }

         for (Iterator itr = tableSet.iterator(); itr.hasNext();)
         {
            Table table = (Table)itr.next();

         loop:
            for (int nIndex = 0, nIndexCount = table.getIndexCount(); nIndex < nIndexCount; ++nIndex)
View Full Code Here

TOP

Related Classes of nexj.core.util.HashHolder

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.