StoredAt

public class StoredAt implements EntityFilterInterface

Fields

PATTERN

public static final java.util.regex.Pattern PATTERN

likeLocation

final String likeLocation

location

String location

pattern_matching

boolean pattern_matching

Constructors

StoredAt

public StoredAt(String loc)

Methods

apply

public void apply(QueryInterface query)

convertLikeLocation

static String convertLikeLocation(String location)

Does some special character escaping for LIKE query.

The following rules should take place in the future (for now, only a subset is implemented correctly):

  • * -> * (No special meaning in SQL, even numbers of are ignored.)

    • -> %% (Wildcard, to be converted to a more complicated regex without / later. Exception: at the beginning of a search expression, convert to %.)

  • ** -> % (Wildcard, also *, **, … -> %)

  • _ -> _ (Prevent special meaning in SQL)

  • % -> % (Prevent special meaning in SQL)

  • Heading / is removed

Parameters:
  • String – location The String to be converted.

Returns:

The converted String.

getCacheKey

public String getCacheKey()

requiresPatternMatching

static boolean requiresPatternMatching(String location)

Tests if the location String is intended for pattern matching.

Parameters:
  • String – location The String to be converted.

Returns:

True if the location requires pattern matching for a LIKE query, false otherwise.

toElement

public Element toElement()

toString

public String toString()

For testing purposes, create a string representing the corresponding query.

Returns:

The String “SAT()”, where “” is the query string.