LOCATE function returns the position of a given string within a string,
starting the search at a specified position. It returns the first position at which the string
was found as an integer. The first argument is the string to be located; the second argument is
the string to be searched; the optional third argument is an integer that represents the string
position at which the search is started (by default, the beginning of the string to be searched).
The first position in a string is denoted by 1. If the string is not found, 0 is returned. The
LENGTH function returns the length of the string in characters as an integer.
BNF: expression ::= LOCATE(string_primary, string_primary [, simple_arithmetic_expression])
LocateExpression
| Access | Constructor and Description |
|---|---|
| public | LocateExpressionStateObject(StateObject
The parent of this state object, which cannot be parent)nullCreates a new |
| public | LocateExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, StateObject nullThe firstStateObject, StateObject StateObject of the first expressionThe secondStateObject)StateObject of the second expressionCreates a new |
| public | LocateExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, StateObject nullThe firstStateObject, StateObject StateObject of the first expressionThe secondStateObject, StateObject StateObject of the second expressionThe thirdStateObject)StateObject of the third encapsulated expressionCreates a new |
| public | LocateExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, String nullThe string representation of the first encapsulated expression to
parse and to convert into a firstJpqlFragment, String StateObject representationThe string representation of the second encapsulated expression to
parse and to convert into a secondJpqlFragment)StateObject representationCreates a new |
| public | LocateExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, String nullThe string representation of the first encapsulated expression to
parse and to convert into a firstJpqlFragment, String StateObject representationThe string representation of the second encapsulated expression to
parse and to convert into a secondJpqlFragment, String StateObject representationThe string representation of the third encapsulated expression to
parse and to convert into a thirdJpqlFragment)StateObject representationCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(StateObjectVisitor
The visitor)visitor to visit this objectImplements org. StateObject by the given visitor.
|
| public LocateExpression | getExpression()
Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| protected String | getFirstQueryBNFId()
Implements abstract org. |
| public String | getIdentifier()
Implements abstract org. AbstractSingleEncapsulatedExpressionStateObject.
|
| protected String | getSecondQueryBNFId()
Implements abstract org. |
| protected String | getThirdQueryBNFId()
Implements abstract org. |
| public void | setExpression(LocateExpression
The expression)parsed object representing a LOCATE
expressionKeeps a reference of the |
| LocateExpressionStateObject | back to summary |
|---|---|
| public LocateExpressionStateObject(StateObject parent) Creates a new
| |
| LocateExpressionStateObject | back to summary |
|---|---|
| public LocateExpressionStateObject(StateObject parent, StateObject firstStateObject, StateObject secondStateObject) Creates a new
| |
| LocateExpressionStateObject | back to summary |
|---|---|
| public LocateExpressionStateObject(StateObject parent, StateObject firstStateObject, StateObject secondStateObject, StateObject thirdStateObject) Creates a new
| |
| LocateExpressionStateObject | back to summary |
|---|---|
| public LocateExpressionStateObject(StateObject parent, String firstJpqlFragment, String secondJpqlFragment) Creates a new
| |
| LocateExpressionStateObject | back to summary |
|---|---|
| public LocateExpressionStateObject(StateObject parent, String firstJpqlFragment, String secondJpqlFragment, String thirdJpqlFragment) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(StateObjectVisitor visitor) Implements org. Doc from org. Visits this
| |
| getExpression | back to summary |
|---|---|
| public LocateExpression getExpression() Implements org. Doc from org. Returns the actual parsed object if this
| |
| getFirstQueryBNFId | back to summary |
|---|---|
| protected String getFirstQueryBNFId() Implements abstract org. Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the first encapsulated expression. | |
| getIdentifier | back to summary |
|---|---|
| public String getIdentifier() Implements abstract org. Returns the JPQL identifier of the expression represented by this | |
| getSecondQueryBNFId | back to summary |
|---|---|
| protected String getSecondQueryBNFId() Implements abstract org. Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the second encapsulated expression. | |
| getThirdQueryBNFId | back to summary |
|---|---|
| protected String getThirdQueryBNFId() Implements abstract org. Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the third encapsulated expression. | |
| setExpression | back to summary |
|---|---|
| public void setExpression(LocateExpression expression) Keeps a reference of the
| |