Enum Class DefaultSqlSerializationContext
java.lang.Object
java.lang.Enum<DefaultSqlSerializationContext>
org.postgresql.core.v3.DefaultSqlSerializationContext
- All Implemented Interfaces:
Serializable, Comparable<DefaultSqlSerializationContext>, Constable, SqlSerializationContext
enum DefaultSqlSerializationContext
extends Enum<DefaultSqlSerializationContext>
implements SqlSerializationContext
Provides a default implementation for
SqlSerializationContext.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRender SQL in a repeatable way (avoid consumingInputStreamsources), use standard_conforming_strings=no string literals.Render SQL with replacing all the parameters, includingInputStreamsources.Render SQL in a repeatable way (avoid consumingInputStreamsources), use standard_conforming_strings=yes string literals.Render SQL with replacing all the parameters, includingInputStreamsources. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDefaultSqlSerializationContext(boolean standardConformingStrings, boolean idempotent) -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the SQL to String conversion should be idempotent.booleanReturns true if strings literals should usestandard_conforming_strings=onencoding.Returns the enum constant of this class with the specified name.static DefaultSqlSerializationContext[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STDSTR_IDEMPOTENT
Render SQL in a repeatable way (avoid consumingInputStreamsources), use standard_conforming_strings=yes string literals. This option is useful fortoString()implementations as it does induce side effects. -
STDSTR_NONIDEMPOTENT
Render SQL with replacing all the parameters, includingInputStreamsources. Use standard_conforming_strings=yes for string literals. This option is useful for rendering an executable SQL. -
NONSTDSTR_IDEMPOTENT
Render SQL in a repeatable way (avoid consumingInputStreamsources), use standard_conforming_strings=no string literals. The entry is for completeness only as standard_conforming_strings=no should probably be avoided. -
NONSTDSTR_NONIDEMPOTENT
Render SQL with replacing all the parameters, includingInputStreamsources. Use standard_conforming_strings=no for string literals. The entry is for completeness only as standard_conforming_strings=no should probably be avoided.
-
-
Field Details
-
standardConformingStrings
private final boolean standardConformingStrings -
idempotent
private final boolean idempotent
-
-
Constructor Details
-
DefaultSqlSerializationContext
private DefaultSqlSerializationContext(boolean standardConformingStrings, boolean idempotent)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getStandardConformingStrings
public boolean getStandardConformingStrings()Description copied from interface:SqlSerializationContextReturns true if strings literals should usestandard_conforming_strings=onencoding.- Specified by:
getStandardConformingStringsin interfaceSqlSerializationContext- Returns:
- true if strings literals should use
standard_conforming_strings=onencoding.
-
getIdempotent
public boolean getIdempotent()Description copied from interface:SqlSerializationContextReturns true if the SQL to String conversion should be idempotent. For instance, if a query parameter comes from anInputStream, then the stream could be skipped when writing SQL with idempotent mode.- Specified by:
getIdempotentin interfaceSqlSerializationContext- Returns:
- true if the SQL to String conversion should be idempotent
-