Class TemplatedExecutableStatementBuilder.EscapingReferenceInsertionEventHandler

  • All Implemented Interfaces:
    org.apache.velocity.app.event.EventHandler, org.apache.velocity.app.event.ReferenceInsertionEventHandler
    Enclosing class:
    TemplatedExecutableStatementBuilder

    protected static class TemplatedExecutableStatementBuilder.EscapingReferenceInsertionEventHandler
    extends Object
    implements org.apache.velocity.app.event.ReferenceInsertionEventHandler
    Escapes SQL values added to the template context.
    • Constructor Detail

      • EscapingReferenceInsertionEventHandler

        protected EscapingReferenceInsertionEventHandler()
    • Method Detail

      • referenceInsert

        public Object referenceInsert​(org.apache.velocity.context.Context context,
                                      String reference,
                                      Object value)
        Specified by:
        referenceInsert in interface org.apache.velocity.app.event.ReferenceInsertionEventHandler
      • encode

        private Object encode​(Object value)
        Replaces single quotes with two single quotes if value is a String.
        Parameters:
        value - to encode
        Returns:
        encoded value if value is a string