Package nexj.core.persistence.operator

Examples of nexj.core.persistence.operator.AttributeOperator


      {
         throw new InvalidQueryException("err.persistence.file.query");
      }
     
      ComparisonOperator op = (ComparisonOperator)query.getWhere();
      AttributeOperator aop;
      ConstantOperator con;
     
      if (op.getLeft().getOrdinal() == AttributeOperator.ORDINAL)
      {
         aop = (AttributeOperator)op.getLeft();
      }
      else if (op.getRight().getOrdinal() == AttributeOperator.ORDINAL)
      {
         aop = (AttributeOperator)op.getRight();
      }
      else
      {
         throw new InvalidQueryException("err.persistence.file.query");
      }
     
      if (op.getLeft().getOrdinal() == ConstantOperator.ORDINAL)
      {
         con = (ConstantOperator)op.getLeft();
      }
      else if (op.getRight().getOrdinal() == ConstantOperator.ORDINAL)
      {
         con = (ConstantOperator)op.getRight();
      }
      else
      {
         throw new InvalidQueryException("err.persistence.file.query");
      }

      OID oid;
     
      /*
       * Two kinds of queries:
       * 1) Lookup by equating a class to an OID.
       * 2) Lookup by equating name field to a string.
       */
      if (aop.getType() instanceof Metaclass)
      {
         if(con.getValue() instanceof OIDHolder)
         {
            oid = ((OIDHolder)con.getValue()).getOID();
         }
View Full Code Here


            if (attribute.getValue() != Undefined.VALUE && !attribute.isPersistent())
            {
               return createOperator(key, attribute.getDispatchedValue(), nOutput);
            }

            return new AttributeOperator(addAttribute(key, attribute, null, false, nOutput));
         }

         return new ConstantOperator(obj);
      }
      catch (ClassCastException e)
View Full Code Here

         if (itr.hasNext())
         {
            InOperator in = new InOperator();

            in.addOperand(new AttributeOperator(typeCodeField));
            in.addOperand(new ConstantOperator(value));

            do
            {
               in.addOperand(new ConstantOperator(itr.next()));
            }
            while (itr.hasNext());

            return in;
         }
         else
         {
            EqualsOperator eq = new EqualsOperator();

            eq.setLeft(new AttributeOperator(typeCodeField));
            eq.setRight(new ConstantOperator(value));

            return eq;
         }
      }
View Full Code Here

                           op.setType(key.getPartType(k));
                           unconvert((AttributeOperator)op);
                        }
                        else
                        {
                           addGroupBy(++i, unconvert(new AttributeOperator(field)));
                        }
                     }
                  }
               }
            }
View Full Code Here

                           op.setType(key.getPartType(k));
                           unconvert((AttributeOperator)op);
                        }
                        else
                        {
                           addOrderBy(++i, unconvert(new AttributeOperator(fieldArray[k])),
                              bAscending ^ key.isPartAscending(k));
                        }
                     }
                  }
               }
View Full Code Here

               }
            }

            if (bPartial)
            {
               addOrderBy(new AttributeOperator(this), true);
            }
         }

         if (m_outputQueryList != null)
         {
View Full Code Here

         for (Iterator itr = m_parentInstanceMap.iterator(); itr.hasNext();)
         {
            oidSet.add(itr.next());
         }

         AttributeOperator aop = new AttributeOperator(new Field(this, m_mapping, m_childItem, m_metaclass, null, null, false));

         if (isCached() && m_persistenceMapping.getCaching() == PersistenceMapping.CACHING_INSTANCE)
         {
            EqualsOperator eq = new EqualsOperator();
View Full Code Here

               Column column = indexColumn.getColumn();
               Field field = new Field(query, mapping, column, column.getValueType(),
                  m_adapter.getConverter(column.getValueType(), column),
                  m_adapter.getBind(column), false);

               op = new AttributeOperator(field);
               bAscending = indexColumn.isAscending() ^ bSortDirectionReversed;
            }

            int nOffset = buf.length();
            String sSuffix = m_adapter.appendSortPrefix(buf, op);
View Full Code Here

            left = ((InOperator)op.getParent()).getOperand(0);
         }

         if (left instanceof AttributeOperator)
         {
            AttributeOperator aop = (AttributeOperator)left;

            if (aop.getConverter() == null)
            {
               column = (Column)((Field)aop.getSource()).getItem();
            }
         }

         if (column != null)
         {
View Full Code Here

       */
      public boolean visit(Operator op)
      {
         if (op instanceof AttributeOperator && op.getParent() == m_parent)
         {
            AttributeOperator aop = (AttributeOperator)op;

            if (!aop.isNoConversion() && aop.getSource() instanceof Field)
            {
               Field field = (Field)aop.getSource();

               if (field.getAttribute() != null)
               {
                  AttributeMapping mapping = field.getAttributeMapping();

View Full Code Here

TOP

Related Classes of nexj.core.persistence.operator.AttributeOperator

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.