Commits

Carlin Desautels committed 8ccab19

fixes #106 SQLiteAdapter: appendStringLiteral: method renamed, pending removal in refs #105

Comments (0)

Files changed (1)

src/nexj/core/persistence/sql/SQLiteAdapter.java

     * @param buf The buffer to append to.
     * @param sValue The value to sanitize and append.
     */
-   protected void appendStringLiteral(StringBuffer buf, String sValue)
+   protected void appendEscaped(StringBuffer buf, String sValue)
    {
       // Escape of single-quotes required in String Literal.
       // Reference http://www.sqlite.org/lang_expr.html
       if (expression instanceof String)
       {
          buf.append('"');
-         appendStringLiteral(buf, expression.toString()); // sanitize
+         appendEscaped(buf, expression.toString()); // sanitize
          buf.append('"');
       }
       else if (expression instanceof Pair)
          if (((Pair)expression).getHead() instanceof String)
          {
             buf.append('"');
-            appendStringLiteral(buf, ((Pair)expression).getHead().toString()); // sanitize
+            appendEscaped(buf, ((Pair)expression).getHead().toString()); // sanitize
             buf.append('"');
          }
          else if (((Pair)expression).getHead() == Symbol.AND) // MatchNode.AND.SYMBOL
          else if (((Pair)expression).getHead() == Symbol.LIKE_P) // MatchNode.FUZZY.SYMBOL
          {
             buf.append('"');
-            appendStringLiteral(buf, ((Pair)expression).getNext().getHead().toString()); // sanitize
+            appendEscaped(buf, ((Pair)expression).getNext().getHead().toString()); // sanitize
             buf.append("*\""); // prefix matching
          }
          else if (((Pair)expression).getHead() == Symbol.OR) // MatchNode.OR.SYMBOL