private void appendValue(RelationQueryNode node, StringBuffer b) { if (node.getValueType() == TYPE_LONG) { b.append(node.getLongValue()); } else if (node.getValueType() == TYPE_DOUBLE) { b.append(node.getDoubleValue()); } else if (node.getValueType() == TYPE_STRING) { b.append("'").append(node.getStringValue().replaceAll("'", "''")).append("'"); } else if (node.getValueType() == TYPE_DATE || node.getValueType() == TYPE_TIMESTAMP) { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); cal.setTime(node.getDateValue()); b.append("TIMESTAMP '").append(ISO8601.format(cal)).append("'"); } else { exceptions.add(new InvalidQueryException("Invalid type: " + node.getValueType())); } }
private void appendValue(RelationQueryNode node, StringBuffer b) { if (node.getValueType() == TYPE_LONG) { b.append(node.getLongValue()); } else if (node.getValueType() == TYPE_DOUBLE) { b.append(node.getDoubleValue()); } else if (node.getValueType() == TYPE_STRING) { b.append("'").append(node.getStringValue().replaceAll("'", "''")).append("'"); } else if (node.getValueType() == TYPE_DATE || node.getValueType() == TYPE_TIMESTAMP) { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); cal.setTime(node.getDateValue()); b.append("TIMESTAMP '").append(ISO8601.format(cal)).append("'"); } else { exceptions.add(new InvalidQueryException("Invalid type: " + node.getValueType())); } }
b.append(node.getDoubleValue()); } else if (node.getValueType() == TYPE_STRING) { b.append("'").append(node.getStringValue().replaceAll("'", "''")).append("'"); } else if (node.getValueType() == TYPE_DATE || node.getValueType() == TYPE_TIMESTAMP) { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
public Object visit(RelationQueryNode node, Object data) throws RepositoryException { StringBuffer buffer = (StringBuffer) data; buffer.append(PADDING, 0, indent); buffer.append("+ RelationQueryNode: Op: "); buffer.append(QueryConstants.OPERATION_NAMES.getName(node.getOperation())); buffer.append(" Prop=["); PathQueryNode relPath = node.getRelativePath(); if (relPath == null) { buffer.append(relPath); } else { visit(relPath, buffer); } buffer.append("] Type=").append(QueryConstants.TYPE_NAMES.getName(node.getValueType())); if (node.getValueType() == QueryConstants.TYPE_DATE) { buffer.append(" Value=").append(node.getDateValue()); } else if (node.getValueType() == QueryConstants.TYPE_DOUBLE) { buffer.append(" Value=").append(node.getDoubleValue()); } else if (node.getValueType() == QueryConstants.TYPE_LONG) { buffer.append(" Value=").append(node.getLongValue()); } else if (node.getValueType() == QueryConstants.TYPE_POSITION) { buffer.append(" Value=").append(node.getPositionValue()); } else if (node.getValueType() == QueryConstants.TYPE_STRING) { buffer.append(" Value=").append(node.getStringValue()); } else if (node.getValueType() == QueryConstants.TYPE_TIMESTAMP) { buffer.append(" Value=").append(node.getDateValue()); } buffer.append("\n"); traverse(node.getOperands(), buffer); return buffer; }
b.append(node.getDoubleValue()); } else if (node.getValueType() == TYPE_STRING) { b.append("'").append(node.getStringValue().replaceAll("'", "''")).append("'"); } else if (node.getValueType() == TYPE_DATE || node.getValueType() == TYPE_TIMESTAMP) { Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
public Object visit(RelationQueryNode node, Object data) throws RepositoryException { StringBuffer buffer = (StringBuffer) data; buffer.append(PADDING, 0, indent); buffer.append("+ RelationQueryNode: Op: "); buffer.append(QueryConstants.OPERATION_NAMES.getName(node.getOperation())); buffer.append(" Prop=["); PathQueryNode relPath = node.getRelativePath(); if (relPath == null) { buffer.append(relPath); } else { visit(relPath, buffer); } buffer.append("] Type=").append(QueryConstants.TYPE_NAMES.getName(node.getValueType())); if (node.getValueType() == QueryConstants.TYPE_DATE) { buffer.append(" Value=").append(node.getDateValue()); } else if (node.getValueType() == QueryConstants.TYPE_DOUBLE) { buffer.append(" Value=").append(node.getDoubleValue()); } else if (node.getValueType() == QueryConstants.TYPE_LONG) { buffer.append(" Value=").append(node.getLongValue()); } else if (node.getValueType() == QueryConstants.TYPE_POSITION) { buffer.append(" Value=").append(node.getPositionValue()); } else if (node.getValueType() == QueryConstants.TYPE_STRING) { buffer.append(" Value=").append(node.getStringValue()); } else if (node.getValueType() == QueryConstants.TYPE_TIMESTAMP) { buffer.append(" Value=").append(node.getDateValue()); } buffer.append("\n"); traverse(node.getOperands(), buffer); return buffer; }
if (node.getOperation() == OPERATION_LIKE && node.getStringValue().indexOf('\\') > -1) { sb.append(" ESCAPE '\\'");
if (node.getOperation() == OPERATION_LIKE && node.getStringValue().indexOf('\\') > -1) { sb.append(" ESCAPE '\\'");
if (rel.getStringValue() == null) { exceptions.add(new InvalidQueryException( "Second argument for rep:similar() must be of type string")); if (rel.getStringValue() == null) { exceptions.add(new InvalidQueryException( "Argument for rep:spellcheck() must be of type string"));
if (rel.getStringValue() == null) { exceptions.add(new InvalidQueryException( "Second argument for rep:similar() must be of type string")); if (rel.getStringValue() == null) { exceptions.add(new InvalidQueryException( "Argument for rep:spellcheck() must be of type string"));
|| node.getOperation() == QueryConstants.OPERATION_NE_VALUE) { stringValues = getStringValues(propertyName, node.getStringValue()); } else { stringValues[0] = node.getStringValue(); || node.getOperation() == QueryConstants.OPERATION_EQ_GENERAL) { if (XMLChar.isValidName(node.getStringValue())) { Name n = session.getQName(ISO9075.decode(node.getStringValue())); query = new NameQuery(n, indexFormatVersion, nsMappings); } catch (NameException e) { case QueryConstants.OPERATION_SIMILAR: try { NodeId id = hmgr.resolveNodePath(session.getQPath(node.getStringValue())); if (id != null) { query = new SimilarityQuery(id.toString(), analyzer);
|| node.getOperation() == QueryConstants.OPERATION_NE_VALUE) { stringValues = getStringValues(propertyName, node.getStringValue()); } else { stringValues[0] = node.getStringValue(); || node.getOperation() == QueryConstants.OPERATION_EQ_GENERAL) { if (XMLChar.isValidName(node.getStringValue())) { Name n = session.getQName(ISO9075.decode(node.getStringValue())); query = new NameQuery(n, indexFormatVersion, nsMappings); } catch (NameException e) { case QueryConstants.OPERATION_SIMILAR: try { NodeId id = hmgr.resolveNodePath(session.getQPath(node.getStringValue())); if (id != null) { query = new SimilarityQuery(id.toString(), analyzer);