Package org.postgresql.core.v3
Enum DefaultSqlSerializationContext
- java.lang.Object
-
- java.lang.Enum<DefaultSqlSerializationContext>
-
- org.postgresql.core.v3.DefaultSqlSerializationContext
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DefaultSqlSerializationContext>
,SqlSerializationContext
enum DefaultSqlSerializationContext extends java.lang.Enum<DefaultSqlSerializationContext> implements SqlSerializationContext
Provides a default implementation forSqlSerializationContext
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NONSTDSTR_IDEMPOTENT
Render SQL in a repeatable way (avoid consumingInputStream
sources), use standard_conforming_strings=no string literals.NONSTDSTR_NONIDEMPOTENT
Render SQL with replacing all the parameters, includingInputStream
sources.STDSTR_IDEMPOTENT
Render SQL in a repeatable way (avoid consumingInputStream
sources), use standard_conforming_strings=yes string literals.STDSTR_NONIDEMPOTENT
Render SQL with replacing all the parameters, includingInputStream
sources.
-
Field Summary
Fields Modifier and Type Field Description private boolean
idempotent
private boolean
standardConformingStrings
-
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 usestandard_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.
-
-
-
Enum Constant Detail
-
STDSTR_IDEMPOTENT
public static final DefaultSqlSerializationContext 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
public static final DefaultSqlSerializationContext 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
public static final DefaultSqlSerializationContext 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
public static final DefaultSqlSerializationContext 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.
-
-
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 namejava.lang.NullPointerException
- 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
-
-