public enum TextMatchStyle extends java.lang.Enum<TextMatchStyle> implements ValueEnum
AdvancedCriteria
.Enum Constant and Description |
---|
EXACT
case-insensitive exact match ("foo" matches "foo" and "FoO", but not "FooBar")
|
EXACT_CASE
case-sensitive exact match ("foo" matches only "foo")
|
STARTS_WITH
case-insensitive prefix match ("foo" matches "FooBar" but not "BarFoo")
|
SUBSTRING
case-insenstive substring match ("foo" matches "foobar" and "BarFoo")
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getValue() |
static TextMatchStyle |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static TextMatchStyle[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TextMatchStyle EXACT
If this enumerated value is used in a Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "exact".
public static final TextMatchStyle EXACT_CASE
If this enumerated value is used in a Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "exactCase".
public static final TextMatchStyle SUBSTRING
If this enumerated value is used in a Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "substring".
public static final TextMatchStyle STARTS_WITH
textMatchStyle behavior is consistent across the client and all three of the built-in server DataSource implementations - SQL, Hibernate and JPA - to the maximum extent that is practical. Known inconsistencies, some of which can be tweaked with configuration settings, are described below
DataSourceField.ignoreTextMatchStyle
declaration. This
behavior is consistent across client and server implementations, with the proviso that case-sensitive behavior is
inherently inconsistent in the server-side implementations (see below for a more detailed discussion of this)primaryKey
fields on update
and remove
operations, unless OperationBinding.allowMultiUpdate
is in force. This
means that a normal update or remove operation - which is constrained by a unique primaryKey value or combination, to
affect only a single data row - will use an equality match on all primaryKey fields. This is desirable because it makes
index usage more likely. Note that this means the key values "foo" and "FOO" are distinct, which is a change from
previous behavior. For most databases, this change will have no effect because most databases do not by default allow
primaryKey values that only differ in case anyway - if a table has a row with a PK of "foo" and you try to insert a
row with a PK of "FOO", most databases will fail with a constraint violation. However, if you are using a database hat
allows key values that differ only in case, and you need to support this for some reason, you can switch the framework
back to the previous behavior by setting property allow.case.sensitive.pks
to true
in your
server.properties
file. Note, we do not recommend this; in fact, we do not recommend the use of text
primaryKey fields at all. Where you have control ,we would always recommend the use of automatically incrementing
numeric sequence keys.field types
. Such fields are always checked for equality. If you have
a need for more complex matching, such as date-range checking, use AdvancedCriteriaDate
objects on the client, instances of
java.util.Date
on the server). Attempting to match against a string or any other type of value will result
in an "always fails" clause being generated. This behavior is how the client code has always worked, but is a change
for the server-side DataSources, in the interests of consistency. The previous behavior was:server.properties
file:
sql.temporal.fields.require.date.criteria: false
server.properties
file:
jpa.temporal.fields.require.date.criteria: false
or hibernate.temporal.fields.require.date.criteria:
false
, as appropriateincludeFrom
declarations or entity
relations in Hibernate or JPA. Again, such comparisons are always for equalityserver.properties
file: sql.substring.numeric.criteria: true
or
hibernate.substring.numeric.criteria: true
or jpa.substring.numeric.criteria: true
, as
appropriateSET IGNORECASE
directive - see here
If this enumerated value is used in a Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "startsWith".
public static TextMatchStyle[] values()
for (TextMatchStyle c : TextMatchStyle.values()) System.out.println(c);
public static TextMatchStyle valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null