Enum DefaultSqlSerializationContext

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      NONSTDSTR_IDEMPOTENT
      Render SQL in a repeatable way (avoid consuming InputStream sources), use standard_conforming_strings=no string literals.
      NONSTDSTR_NONIDEMPOTENT
      Render SQL with replacing all the parameters, including InputStream sources.
      STDSTR_IDEMPOTENT
      Render SQL in a repeatable way (avoid consuming InputStream sources), use standard_conforming_strings=yes string literals.
      STDSTR_NONIDEMPOTENT
      Render SQL with replacing all the parameters, including InputStream sources.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DefaultSqlSerializationContext​(boolean standardConformingStrings, boolean idempotent)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getIdempotent()
      Returns true if the SQL to String conversion should be idempotent.
      boolean getStandardConformingStrings()
      Returns true if strings literals should use standard_conforming_strings=on encoding.
      static DefaultSqlSerializationContext valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DefaultSqlSerializationContext[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • STDSTR_IDEMPOTENT

        public static final DefaultSqlSerializationContext STDSTR_IDEMPOTENT
        Render SQL in a repeatable way (avoid consuming InputStream sources), use standard_conforming_strings=yes string literals. This option is useful for toString() implementations as it does induce side effects.
      • STDSTR_NONIDEMPOTENT

        public static final DefaultSqlSerializationContext STDSTR_NONIDEMPOTENT
        Render SQL with replacing all the parameters, including InputStream sources. Use standard_conforming_strings=yes for string literals. This option is useful for rendering an executable SQL.
      • NONSTDSTR_IDEMPOTENT

        public static final DefaultSqlSerializationContext NONSTDSTR_IDEMPOTENT
        Render SQL in a repeatable way (avoid consuming InputStream sources), use standard_conforming_strings=no string literals. The entry is for completeness only as standard_conforming_strings=no should probably be avoided.
      • NONSTDSTR_NONIDEMPOTENT

        public static final DefaultSqlSerializationContext NONSTDSTR_NONIDEMPOTENT
        Render SQL with replacing all the parameters, including InputStream sources. Use standard_conforming_strings=no for string literals. The entry is for completeness only as standard_conforming_strings=no should probably be avoided.
    • Field Detail

      • standardConformingStrings

        private final boolean standardConformingStrings
      • idempotent

        private final boolean idempotent
    • Constructor Detail

      • DefaultSqlSerializationContext

        private DefaultSqlSerializationContext​(boolean standardConformingStrings,
                                               boolean idempotent)
    • Method Detail

      • values

        public static DefaultSqlSerializationContext[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DefaultSqlSerializationContext c : DefaultSqlSerializationContext.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DefaultSqlSerializationContext valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getStandardConformingStrings

        public boolean getStandardConformingStrings()
        Description copied from interface: SqlSerializationContext
        Returns true if strings literals should use standard_conforming_strings=on encoding.
        Specified by:
        getStandardConformingStrings in interface SqlSerializationContext
        Returns:
        true if strings literals should use standard_conforming_strings=on encoding.
      • getIdempotent

        public boolean getIdempotent()
        Description copied from interface: SqlSerializationContext
        Returns true if the SQL to String conversion should be idempotent. For instance, if a query parameter comes from an InputStream, then the stream could be skipped when writing SQL with idempotent mode.
        Specified by:
        getIdempotent in interface SqlSerializationContext
        Returns:
        true if the SQL to String conversion should be idempotent