public void printPrimitive(Object value) { if (value instanceof Collection) { printValuelist((Collection)value); return; } session.getPlatform().appendLiteralToCall(getCall(), getWriter(), value); }
public void printValuelist(Collection values) { try { getWriter().write("("); Iterator valuesEnum = values.iterator(); while (valuesEnum.hasNext()) { Object value = valuesEnum.next(); // Support nested arrays for IN. if (value instanceof Collection) { printValuelist((Collection)value); } else if (value instanceof Expression) { ((Expression)value).printSQL(this); } else { session.getPlatform().appendLiteralToCall(getCall(), getWriter(), value); } if (valuesEnum.hasNext()) { getWriter().write(", "); } } getWriter().write(")"); } catch (IOException exception) { throw ValidationException.fileError(exception); } }
public void printValuelist(Collection values) { try { getWriter().write("("); Iterator valuesEnum = values.iterator(); while (valuesEnum.hasNext()) { Object value = valuesEnum.next(); // Support nested arrays for IN. if (value instanceof Collection) { printValuelist((Collection)value); } else if (value instanceof Expression) { ((Expression)value).printSQL(this); } else { session.getPlatform().appendLiteralToCall(getCall(), getWriter(), value); } if (valuesEnum.hasNext()) { getWriter().write(", "); } } getWriter().write(")"); } catch (IOException exception) { throw ValidationException.fileError(exception); } }
public void printPrimitive(Object value) { if (value instanceof Collection) { printValuelist((Collection)value); return; } session.getPlatform().appendLiteralToCall(getCall(), getWriter(), value); }
public void printPrimitive(Object value) { if (value instanceof Collection) { printValuelist((Collection)value); return; } session.getPlatform().appendLiteralToCall(getCall(), getWriter(), value); }
/** * INTERNAL: * Print SQL onto the stream, using the ExpressionPrinter for context */ public void printSQL(ExpressionSQLPrinter printer) { if (printer.shouldPrintParameterValues()) { Object value = getValue(printer.getTranslationRow(), printer.getSession()); if (value instanceof Collection) { printer.printValuelist((Collection)value); }else{ if(getField() == null) { printer.printPrimitive(value); } else { printer.printParameter(this); } } } else { if (getField() != null) { printer.printParameter(this); } } }
/** * INTERNAL: * Print SQL onto the stream, using the ExpressionPrinter for context */ public void printSQL(ExpressionSQLPrinter printer) { if (printer.shouldPrintParameterValues()) { Object value = getValue(printer.getTranslationRow(), printer.getSession()); if (value instanceof Collection) { printer.printValuelist((Collection)value); }else{ if(getField() == null) { printer.printPrimitive(value); } else { printer.printParameter(this); } } } else { if (getField() != null) { printer.printParameter(this); } } }
/** * INTERNAL: * Print SQL onto the stream, using the ExpressionPrinter for context */ public void printSQL(ExpressionSQLPrinter printer) { if (printer.shouldPrintParameterValues()) { Object value = getValue(printer.getTranslationRow(), printer.getSession()); if (value instanceof Collection) { printer.printValuelist((Collection)value); }else{ if(getField() == null) { printer.printPrimitive(value); } else { printer.printParameter(this); } } } else { if (getField() != null) { printer.printParameter(this); } } }