Examples of RelationQueryNode


Examples of org.exoplatform.services.jcr.impl.core.query.RelationQueryNode

    */
   private RelationQueryNode createRelationQueryNode(QueryNode parent, InternalQName propertyName, int operationType,
      ASTLiteral literal) throws IllegalArgumentException
   {

      RelationQueryNode node = null;

      try
      {
         QPath relPath = null;
         if (propertyName != null)
         {
            relPath = new QPath(new QPathEntry[]{new QPathEntry(propertyName, 0)});
         }
         if (literal == null)
         {
            node = factory.createRelationQueryNode(parent, operationType);
            node.setRelativePath(relPath);
         }
         else if (literal.getType() == QueryConstants.TYPE_DATE)
         {
            SimpleDateFormat format = new SimpleDateFormat(DATE_PATTERN);
            Date date = format.parse(literal.getValue());
            node = factory.createRelationQueryNode(parent, operationType);
            node.setRelativePath(relPath);
            node.setDateValue(date);
         }
         else if (literal.getType() == QueryConstants.TYPE_DOUBLE)
         {
            double d = Double.parseDouble(literal.getValue());
            node = factory.createRelationQueryNode(parent, operationType);
            node.setRelativePath(relPath);
            node.setDoubleValue(d);
         }
         else if (literal.getType() == QueryConstants.TYPE_LONG)
         {
            long l = Long.parseLong(literal.getValue());
            node = factory.createRelationQueryNode(parent, operationType);
            node.setRelativePath(relPath);
            node.setLongValue(l);
         }
         else if (literal.getType() == QueryConstants.TYPE_STRING)
         {
            node = factory.createRelationQueryNode(parent, operationType);
            node.setRelativePath(relPath);
            node.setStringValue(literal.getValue());
         }
         else if (literal.getType() == QueryConstants.TYPE_TIMESTAMP)
         {
            Calendar c = ISO8601.parse(literal.getValue());
            node = factory.createRelationQueryNode(parent, operationType);
            node.setRelativePath(relPath);
            node.setDateValue(c.getTime());
         }
      }
      catch (java.text.ParseException e)
      {
         throw new IllegalArgumentException(e.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.