@Override public int compare(Object o1, Object o2) { Class<?> clazz = o1.getClass(); if (clazz == String.class) { CharSequence s1 = (CharSequence)o1; CharSequence s2 = (CharSequence)o2; return comparePadded(s1, s2); } else if (clazz == ClobType.class) { CharSequence s1 = ((ClobType)o1).getCharSequence(); CharSequence s2 = ((ClobType)o2).getCharSequence(); return comparePadded(s1, s2); } return ((Comparable<Object>)o1).compareTo(o2); } };
@Override public int compare(Object o1, Object o2) { Class<?> clazz = o1.getClass(); if (clazz == String.class) { CharSequence s1 = (CharSequence)o1; CharSequence s2 = (CharSequence)o2; return comparePadded(s1, s2); } else if (clazz == ClobType.class) { CharSequence s1 = ((ClobType)o1).getCharSequence(); CharSequence s2 = ((ClobType)o2).getCharSequence(); return comparePadded(s1, s2); } return ((Comparable<Object>)o1).compareTo(o2); } };
@Override public int compare(Object o1, Object o2) { Class<?> clazz = o1.getClass(); if (clazz == String.class) { CharSequence s1 = (CharSequence)o1; CharSequence s2 = (CharSequence)o2; return comparePadded(s1, s2); } else if (clazz == ClobType.class) { CharSequence s1 = ((ClobType)o1).getCharSequence(); CharSequence s2 = ((ClobType)o2).getCharSequence(); return comparePadded(s1, s2); } return ((Comparable<Object>)o1).compareTo(o2); } };
ClobType clob = (ClobType)object; writer.append('"'); JSONParser.escape(clob.getCharSequence(), writer); writer.append('"');
ClobType clob = (ClobType)object; writer.append('"'); JSONParser.escape(clob.getCharSequence(), writer); writer.append('"');
JSONParser.escape(clob.getCharSequence(), writer); writer.append('"');
@TeiidFunction(name=SourceSystemFunctions.REGEXP_REPLACE, category=FunctionCategoryConstants.STRING, nullOnNull=true) public static ClobType regexpReplace(CommandContext context, ClobType source, String regex, String replacement, String flags) throws FunctionExecutionException { //TODO: this is not very memory safe - we can write out to the buffermanger if needed String result = regexpReplace(context, source.getCharSequence(), regex, replacement, flags); return new ClobType(new ClobImpl(result)); }
@TeiidFunction(name=SourceSystemFunctions.REGEXP_REPLACE, category=FunctionCategoryConstants.STRING, nullOnNull=true) public static ClobType regexpReplace(CommandContext context, ClobType source, String regex, String replacement, String flags) throws FunctionExecutionException { //TODO: this is not very memory safe - we can write out to the buffermanger if needed String result = regexpReplace(context, source.getCharSequence(), regex, replacement, flags); return new ClobType(new ClobImpl(result)); }
@TeiidFunction(name=SourceSystemFunctions.REGEXP_REPLACE, category=FunctionCategoryConstants.STRING, nullOnNull=true) public static ClobType regexpReplace(CommandContext context, ClobType source, String regex, String replacement, String flags) throws FunctionExecutionException { //TODO: this is not very memory safe - we can write out to the buffermanger if needed String result = regexpReplace(context, source.getCharSequence(), regex, replacement, flags); return new ClobType(new ClobImpl(result)); }