public class SqlCollation extends Object implements Serializable
SqlCollation is an object representing a Collate
statement. It is immutable.| Modifier and Type | Class and Description |
|---|---|
static class |
SqlCollation.Coercibility
A <character value expression> consisting of a column
reference has the coercibility characteristic Implicit, with collating
sequence as defined when the column was created.
|
| Modifier and Type | Field and Description |
|---|---|
static SqlCollation |
COERCIBLE |
protected String |
collationName |
static SqlCollation |
IMPLICIT |
protected Locale |
locale |
protected String |
strength |
protected SerializableCharset |
wrappedCharset |
| Constructor and Description |
|---|
SqlCollation(SqlCollation.Coercibility coercibility)
Creates a SqlCollation with the default collation name and the given
coercibility.
|
SqlCollation(SqlCollation.Coercibility coercibility,
Locale locale,
Charset charset,
String strength)
Creates a Collation by its coercibility, locale, charset and strength.
|
SqlCollation(String collation,
SqlCollation.Coercibility coercibility)
Creates a Collation by its name and its coercibility.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(@Nullable Object o) |
protected String |
generateCollationName(Charset charset) |
Charset |
getCharset() |
SqlCollation.Coercibility |
getCoercibility() |
protected static @Nullable SqlCollation |
getCoercibilityDyadic(SqlCollation col1,
SqlCollation col2)
|
static String |
getCoercibilityDyadicComparison(SqlCollation col1,
SqlCollation col2)
Returns the collating sequence (the collation name) to use for the
resulting value of a comparison.
|
static @Nullable SqlCollation |
getCoercibilityDyadicOperator(SqlCollation col1,
SqlCollation col2)
Returns the collating sequence (the collation name) and the coercibility
for the resulting value of a dyadic operator.
|
static SqlCollation |
getCoercibilityDyadicOperatorThrows(SqlCollation col1,
SqlCollation col2)
Returns the collating sequence (the collation name) and the coercibility
for the resulting value of a dyadic operator.
|
String |
getCollationName() |
@Nullable Collator |
getCollator()
Returns the
Collator to compare values having the current
collation, or null if no specific Collator is needed, in
which case String.compareTo(java.lang.String) will be used. |
Locale |
getLocale() |
int |
hashCode() |
String |
toString() |
void |
unparse(SqlWriter writer) |
public static final SqlCollation COERCIBLE
public static final SqlCollation IMPLICIT
protected final String collationName
protected final SerializableCharset wrappedCharset
protected final Locale locale
protected final String strength
public SqlCollation(SqlCollation.Coercibility coercibility)
coercibility - Coercibilitypublic SqlCollation(String collation, SqlCollation.Coercibility coercibility)
collation - Collation specificationcoercibility - Coercibilitypublic SqlCollation(SqlCollation.Coercibility coercibility, Locale locale, Charset charset, String strength)
protected String generateCollationName(@UnderInitialization SqlCollation this, Charset charset)
public static @Nullable SqlCollation getCoercibilityDyadicOperator(SqlCollation col1, SqlCollation col2)
col1 - first operand for the dyadic operationcol2 - second operand for the dyadic operationSQL:1999 Part 2 Section 4.2.3 Table 2public static SqlCollation getCoercibilityDyadicOperatorThrows(SqlCollation col1, SqlCollation col2)
col1 - first operand for the dyadic operationcol2 - second operand for the dyadic operationCalciteException - from
CalciteResource.invalidCompare(java.lang.String, java.lang.String, java.lang.String, java.lang.String) or
CalciteResource.differentCollations(java.lang.String, java.lang.String)
if no collating sequence can be deducedSQL:1999 Part 2 Section 4.2.3 Table 2public static String getCoercibilityDyadicComparison(SqlCollation col1, SqlCollation col2)
col1 - first operand for the dyadic operationcol2 - second operand for the dyadic operationCalciteResource.invalidCompare(java.lang.String, java.lang.String, java.lang.String, java.lang.String)SQL:1999 Part 2 Section 4.2.3 Table 3protected static @Nullable SqlCollation getCoercibilityDyadic(SqlCollation col1, SqlCollation col2)
public void unparse(SqlWriter writer)
public Charset getCharset()
public final String getCollationName()
public final SqlCollation.Coercibility getCoercibility()
public final Locale getLocale()
@Pure public @Nullable Collator getCollator()
Collator to compare values having the current
collation, or null if no specific Collator is needed, in
which case String.compareTo(java.lang.String) will be used.Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.