Package nexj.core.persistence

Examples of nexj.core.persistence.Field


         if (m_source instanceof Field)
         {
            writer.write(' ');

            Field field = (Field)m_source;

            if (field.getAttribute() != null)
            {
              writer.write(field.getAttribute().getName());
            }
            else if (field.getItem() != null)
            {
               writer.write('<');
               writer.print(field.getItem());
               writer.write('>');
            }
            else
            {
               writer.write('?');
View Full Code Here


      path = getWhereAssoc(root, query, path);

      if (m_source instanceof Field)
      {
         Field field = (Field)m_source;

         if (field.getAttribute() != null)
         {
            path = new Pair(field.getAttribute().getSymbol(), path);
         }
         else if (field.getItem() instanceof Field)
         {
            field = (Field)field.getItem();

            if (field.getAttribute() != null)
            {
               path = new Pair(field.getAttribute().getSymbol(), path);
            }
         }
      }

      return Pair.nreverse(path);
View Full Code Here

               Operator result = null;

               if (leftFieldArray.length == 1)
               {
                  Field field = leftFieldArray[0];

                  if (m_left.getQuery().getConstraint() != this)
                  {
                     m_left.setSource(field);
                     m_left.setType(field.getType());

                     if (rightFieldArray != null)
                     {
                        field = rightFieldArray[0];
                        m_right.setSource(field);
                        m_right.setType(field.getType());
                     }
                     else
                     {
                        ConstantOperator cons;
                        Object value = (valueArray == null) ? null : valueArray[0];
View Full Code Here

               assert nCount > 0;

               if (nCount == 1)
               {
                  Field field = fieldArray[0];

                  first.setSource(field);
                  first.setType(field.getType());

                  for (int i = 1; i < m_nOperandCount; ++i)
                  {
                     Operator op = m_operandArray[i];
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

    */
   protected static Object createKeyItem(VirtualKey key, Query query)
   {
      if (key.isOIDAttribute())
      {
         return new Field(query, key.getAttribute(0), true);
      }

      int nCount = key.getAttributeCount();
      Field[] fkFieldArray = new Field[nCount];

      for (int i = 0; i < nCount; i++)
      {
         fkFieldArray[i] = new Field(query, key.getAttribute(i), true);
      }

      return fkFieldArray;
   }
View Full Code Here

    */
   public Object getValue(OID oid, Source source)
   {
      if (source instanceof Field)
      {
         Field field = (Field)source;
         Attribute attribute = field.getAttribute();

         if (attribute.getType().isPrimitive())
         {
            VirtualPrimitiveMapping attrMapping = (VirtualPrimitiveMapping)field.getAttributeMapping();
            int nKeyPart = attrMapping.getObjectKeyPart();

            if (nKeyPart >= 0)
            {
               return oid.getValue(nKeyPart);
View Full Code Here

    */
   public Object getValue(PropertyMap instance, Source source)
   {
      if (source instanceof Field)
      {
         Field field = (Field)source;
         Object item = field.getItem();

         if (item == VirtualAdapter.OID)
         {
            if (instance instanceof OIDHolder)
            {
View Full Code Here

            instance.cache(oid);
         }

         for (Iterator i = query.getFieldIterator(); i.hasNext(); )
         {
            Field field = (Field)i.next();
            Attribute attribute = field.getAttribute();
            FilePrimitiveMapping primitiveMapping = (FilePrimitiveMapping)query.getPersistenceMapping().getAttributeMapping(attribute);
           
            switch (primitiveMapping.getSysId())
            {
               case FilePrimitiveMapping.SYSID_ID:
View Full Code Here

   public Object getValue(OID oid, Source source)
   {
      if (source instanceof Field)
      {
         Column column = null;
         Field field = (Field)source;
         RelationalPrimitiveMapping mapping = (RelationalPrimitiveMapping)field.getAttributeMapping();

         if (mapping != null)
         {
            column = mapping.getColumn();
         }
         else if (field.getItem() instanceof Column)
         {
            column = (Column)field.getItem();
         }

         if (column != null && column.isPrimary())
         {
            IndexColumn indexColumn = ((Index)((RelationalMapping)source.getQuery()
View Full Code Here

TOP

Related Classes of nexj.core.persistence.Field

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.