Package nexj.core.persistence

Examples of nexj.core.persistence.Converter


         else if (m_right.isConstant())
         {
            if (m_left.getOrdinal() == AttributeOperator.ORDINAL)
            {
               AttributeOperator left = (AttributeOperator)m_left;
               Converter converter = left.getConverter();

               if (converter != null && (isEquivalence() ||
                  Primitive.isOrderPreserved(converter.getSourceType(), converter.getDestinationType())))
               {
                  left.setType(converter.getSourceType());
                  left.setNoConversion(true);
                  m_right.setValue(converter.getInverseFunction().invoke(m_right.getValue()));
                  m_right.setType(converter.getSourceType());
               }
            }
            else if (m_left.getType() == Primitive.BOOLEAN && m_right.getValue() != null)
            {
               switch (booleanPredicate(((Boolean)m_right.getValue()).booleanValue()))
View Full Code Here


         else
         {
            if (first.getOrdinal() == AttributeOperator.ORDINAL)
            {
               AttributeOperator aop = (AttributeOperator)first;
               Converter converter = aop.getConverter();

               if (converter != null)
               {
                  aop.setType(converter.getSourceType());
                  aop.setNoConversion(true);

                  for (int i = 1; i < m_nOperandCount; ++i)
                  {
                     Operator op = m_operandArray[i];

                     op.setValue(converter.getInverseFunction().invoke(op.getValue()));
                     op.setType(converter.getSourceType());
                  }
               }
            }

            if (bNull)
View Full Code Here

    * @param toType The type to which to convert.
    * @throws TypeConversionException if the conversion is not supported.
    */
   public Converter getDefaultConverter(Primitive fromType, Primitive toType) throws TypeConversionException
   {
      Converter converter = s_converterArray[fromType.getOrdinal() * Primitive.MAX_COUNT + toType.getOrdinal()];

      if (converter == null)
      {
         throw new TypeConversionException(toType);
      }
View Full Code Here

    * @param value The value to convert.
    * @return The converted value.
    */
   public final Object toBind(Column column, Object value)
   {
      Converter converter = getConverter(column.getValueType(), column);

      if (converter == null)
      {
         return value;
      }

      return converter.getInverseFunction().invoke(value);
   }
View Full Code Here

    * @param value The value to convert.
    * @return The converted value.
    */
   public final Object toValue(Column column, Object value)
   {
      Converter converter = getConverter(column.getValueType(), column);

      if (converter == null)
      {
         return value;
      }

      return converter.getForwardFunction().invoke(value);
   }
View Full Code Here

         }
         else
         {
            m_adapter.appendBind(buf, getBindCount());

            Converter converter = ((AttributeOperator)op).getConverter();

            if (converter == null)
            {
               addBind(m_adapter.getBind(Primitive.BOOLEAN),
                  m_adapter.getInternal(Primitive.BOOLEAN, value));
            }
            else
            {
               addBind(m_adapter.getBind(converter.getSourceType()),
                  converter.getInverseFunction().invoke(value));
            }
         }

         if (bParen)
         {
View Full Code Here

TOP

Related Classes of nexj.core.persistence.Converter

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.