Package org.postgresql.core.v3
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 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRender SQL in a repeatable way (avoid consumingInputStream
sources), use standard_conforming_strings=no string literals.Render SQL with replacing all the parameters, includingInputStream
sources.Render SQL in a repeatable way (avoid consumingInputStream
sources), use standard_conforming_strings=yes string literals.Render SQL with replacing all the parameters, includingInputStream
sources. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
DefaultSqlSerializationContext
(boolean standardConformingStrings, boolean idempotent) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the SQL to String conversion should be idempotent.boolean
Returns true if strings literals should usestandard_conforming_strings=on
encoding.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 consumingInputStream
sources), 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, includingInputStream
sources. 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 consumingInputStream
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
Render SQL with replacing all the parameters, includingInputStream
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 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:SqlSerializationContext
Returns true if strings literals should usestandard_conforming_strings=on
encoding.- Specified by:
getStandardConformingStrings
in interfaceSqlSerializationContext
- 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 anInputStream
, then the stream could be skipped when writing SQL with idempotent mode.- Specified by:
getIdempotent
in interfaceSqlSerializationContext
- Returns:
- true if the SQL to String conversion should be idempotent
-