|
Spring Data Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.data.repository.query.parser.PartTree
public class PartTree
Class to parse a String
into a tree or PartTree.OrPart
s consisting of simple PartTree.OrPart
instances in turn.
Takes a domain class as well to validate that each of the PartTree.OrPart
s are referring to a property of the domain
class. The PartTree
can then be used to build queries based on its API instead of parsing the method name for
each query execution.
Nested Class Summary | |
---|---|
static class |
PartTree.OrPart
A part of the parsed source that results from splitting up the resource around Or keywords. |
Constructor Summary | |
---|---|
PartTree(String source,
Class<?> domainClass)
Creates a new PartTree by parsing the given String . |
Method Summary | |
---|---|
Iterable<Part> |
getParts()
Returns an Iterable of all parts contained in the PartTree . |
Iterable<Part> |
getParts(Part.Type type)
Returns all PartTree.OrPart s of the PartTree of the given Part.Type . |
Sort |
getSort()
Returns the Sort specification parsed from the source or null. |
Boolean |
isCountProjection()
Returns whether a count projection shall be applied. |
boolean |
isDistinct()
Returns whether we indicate distinct lookup of entities. |
Iterator<PartTree.OrPart> |
iterator()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PartTree(String source, Class<?> domainClass)
PartTree
by parsing the given String
.
source
- the String
to parsedomainClass
- the domain class to check individual parts against to ensure they refer to a property of the
classMethod Detail |
---|
public Iterator<PartTree.OrPart> iterator()
iterator
in interface Iterable<PartTree.OrPart>
public Sort getSort()
Sort
specification parsed from the source or null.
public boolean isDistinct()
public Boolean isCountProjection()
public Iterable<Part> getParts()
Iterable
of all parts contained in the PartTree
.
PartTree.OrPart
spublic Iterable<Part> getParts(Part.Type type)
PartTree.OrPart
s of the PartTree
of the given Part.Type
.
type
-
public String toString()
toString
in class Object
|
Spring Data Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |