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_IDEMPOTENTRender SQL in a repeatable way (avoid consumingInputStreamsources), use standard_conforming_strings=no string literals.NONSTDSTR_NONIDEMPOTENTRender SQL with replacing all the parameters, includingInputStreamsources.STDSTR_IDEMPOTENTRender SQL in a repeatable way (avoid consumingInputStreamsources), use standard_conforming_strings=yes string literals.STDSTR_NONIDEMPOTENTRender SQL with replacing all the parameters, includingInputStreamsources.
-
Field Summary
Fields Modifier and Type Field Description private booleanidempotentprivate booleanstandardConformingStrings
-
Constructor Summary
Constructors Modifier Constructor Description privateDefaultSqlSerializationContext(boolean standardConformingStrings, boolean idempotent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetIdempotent()Returns true if the SQL to String conversion should be idempotent.booleangetStandardConformingStrings()Returns true if strings literals should usestandard_conforming_strings=onencoding.static DefaultSqlSerializationContextvalueOf(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 consumingInputStreamsources), 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, includingInputStreamsources. 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 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
public static final DefaultSqlSerializationContext 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.
-
-
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: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
-
-