org.hibernate.criterion

Class MatchMode

Implemented Interfaces:
Serializable

public abstract class MatchMode
extends java.lang.Object
implements Serializable

Represents an strategy for matching strings using "like".
Author:
Gavin King
See Also:
Example.enableLike(MatchMode)

Field Summary

static MatchMode
ANYWHERE
Match the pattern anywhere in the string
static MatchMode
END
Match the end of the string to the pattern
static MatchMode
EXACT
Match the entire string to the pattern
static MatchMode
START
Match the start of the string to the pattern

Constructor Summary

MatchMode(String name)

Method Summary

abstract String
toMatchString(String pattern)
convert the pattern, by appending/prepending "%"
String
toString()

Field Details

ANYWHERE

public static final MatchMode ANYWHERE
Match the pattern anywhere in the string

END

public static final MatchMode END
Match the end of the string to the pattern

EXACT

public static final MatchMode EXACT
Match the entire string to the pattern

START

public static final MatchMode START
Match the start of the string to the pattern

Constructor Details

MatchMode

protected MatchMode(String name)

Method Details

toMatchString

public abstract String toMatchString(String pattern)
convert the pattern, by appending/prepending "%"

toString

public String toString()