Package nexj.core.persistence

Examples of nexj.core.persistence.Query$MultiArgOperatorFactory


      {
         writer.write(" ?");
      }
      else
      {
         Query query = m_source.getQuery();

         if (query == null)
         {
            writer.write(" ?");
         }
         else
         {
            if (query.isInverse())
            {
               writer.write("@ ");
               writer.write(query.getMetaclass().getName());
            }

            printAssoc(query, writer);
         }
View Full Code Here


    * @param writer The destination writer.
    * @throws IOException if the writer encounters an error.
    */
   private static void printAssoc(Query query, PrintWriter writer) throws IOException
   {
      Query root = (writer.getWriter() instanceof QueryHolder) ?
         ((QueryHolder)writer.getWriter()).getQuery() : null;

      if (query != root)
      {
         Query parent = query.getParent();

         if (parent == null)
         {
            writer.write("@ ");
            writer.write(query.getMetaclass().getName());
         }
         else
         {
            if (parent != root && !query.isInverse())
            {
               printAssoc(parent, writer);
            }

            writer.write(' ');
            writer.write(query.getAttribute().getName());

            if (parent != root && query.isInverse() &&
               (root != null || parent.getParent() != root))
            {
               printAssoc(parent, writer);
            }
         }
      }
View Full Code Here

    */
   private static Pair getWhereAssoc(Query root, Query query, Pair path)
   {
      if (query != root)
      {
         Query parent = query.getParent();

         if (parent == null)
         {
            path.setHead(Symbol.ATAT);
            path = new Pair(query.getMetaclass().getSymbol(), path);
         }
         else
         {
            if (parent != root && !query.isInverse())
            {
               path = getWhereAssoc(root, parent, path);
            }

            path = new Pair(query.getAttribute().getSymbol(), path);

            if (parent != root && query.isInverse() &&
               (root != null || parent.getParent() != root))
            {
               getWhereAssoc(root, parent, path);
            }
         }
      }
View Full Code Here

    * @see nexj.core.persistence.Operator#getExpression(nexj.core.persistence.Query)
    */
   public Object getExpression(Query root)
   {
      Pair path = new Pair(Symbol.AT);
      Query query = m_source.getQuery();

      if (query.isInverse())
      {
         path.setHead(Symbol.ATAT);
         path = new Pair(query.getMetaclass().getSymbol(), path);
      }

      path = getWhereAssoc(root, query, path);

      if (m_source instanceof Field)
View Full Code Here

                     throw new IllegalArgumentException("Too many query arguments");
                  }
               }
            }
           
            Query query = Query.createRead(m_context.getMetadata().getMetaclass(classSymbol.getName()),
               attributes, where, null, -1, 0, false, Query.SEC_NONE, m_context);

            resultList.addAll((List)RPCUtil.transfer(query.read(), attributes, identityMap, RPCUtil.TF_ALL));
         }

         writer = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file)), XMLUtil.ENCODING);

         new SOAPMarshaller(m_context).serialize(resultList, writer);
View Full Code Here

   {
      InvocationContext context = new InvocationContext(Repository.getMetadata());
      MatchOperator op = new MatchOperator(context);
      Metaclass metaclass = context.getMetadata().getMetaclass("Contact");
      AttributeOperator attribOp = new AttributeOperator(
         new Field(new Query(metaclass, context), metaclass.getAttribute("firstName")));

      context.setLocale(Locale.ENGLISH);
      op.setAttribute(attribOp);
      attribOp.setConstant(true);
      attribOp.setValue("a abc def ghi");
View Full Code Here

         aop = null;
      }

      if (aop != null && aop.getSource() instanceof Query)
      {
         Query query = (Query)aop.getSource();

         if (query.getConstraint() == null)
         {
            query.setConstraint(this);
         }
      }
   }
View Full Code Here

         }
      }

      for (int nQuery = 1; nQuery < query.getOutputQueryCount(); nQuery++)
      {
         Query subQuery = query.getOutputQuery(nQuery);
         Object subMap = mapping.findComposition(map, subQuery.getAttribute());

         if (!(subMap instanceof Lookup) || !isComposition(subQuery, mapping, (Lookup)subMap))
         {
            return false;
         }
View Full Code Here

         {
            attrSet.set(((Field)source).getAttribute().getOrdinal());
         }
         else
         {
            Query assoc = source.getQuery();

            if (assoc.getParent() == query)
            {
               attrSet.set(assoc.getAttribute().getOrdinal());
            }
         }
      }

      if (!attrSet.isEmpty())
View Full Code Here

      assert query.isRoot();

      for (int nQuery = 1; nQuery < query.getOutputQueryCount(); nQuery++)
      {
         Query subQuery = query.getOutputQuery(nQuery);

         if (!subQuery.isRoot())
         {
            Object attr = subQuery.getAttribute().getSymbol();

            if ((subQuery = subQuery.getParent()) != query)
            {
               attr = new Pair(attr);

               do
               {
                  attr = new Pair(subQuery.getAttribute().getSymbol(), attr);
                  subQuery = subQuery.getParent();
               }
               while (subQuery != query);
            }

            compAttrs = new Pair(attr, compAttrs);
View Full Code Here

TOP

Related Classes of nexj.core.persistence.Query$MultiArgOperatorFactory

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.