Class LikeAllFunction
java.lang.Object
ch.tocco.nice2.persist.core.impl.hibernate.query.likeall.LikeAllFunction
- All Implemented Interfaces:
QueryFunction
Implementation of our old "fulltext-search" function.
Example query:
find Address where crosslike("word", fieldname1, fieldname2, fieldname3)
The crosslike function will translate this query into a OR combination comparing
each field name against the string literal using EquationNode.Operator.LIKE.
So the example from above is transalted to this:
fieldname1~"word1" or fieldname2~"word1" or fieldname3~"word1"In case a path contains references to relations, this function partitions the crosslike among equal path names.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()The unique function name.partitionLike(NodeContainer container) Partitions the children (actually the function's arguments) into a set of OR nodes each containing the children that belong to the same path set.postCompile(Cursor cursor, FuncallNode functionRoot, EntityModel entityModel) Applies this function to the given (sub)tree.
-
Constructor Details
-
LikeAllFunction
public LikeAllFunction()
-
-
Method Details
-
getName
Description copied from interface:QueryFunctionThe unique function name.- Specified by:
getNamein interfaceQueryFunction
-
postCompile
public Node postCompile(Cursor cursor, FuncallNode functionRoot, EntityModel entityModel) throws Exception Description copied from interface:QueryFunctionApplies this function to the given (sub)tree.- Specified by:
postCompilein interfaceQueryFunction- Throws:
Exception
-
partitionLike
Partitions the children (actually the function's arguments) into a set of OR nodes each containing the children that belong to the same path set. It creates and returns a new OR node containing itself OR nodes that represent the partitions. Each nested OR node contains a subset of the children of the specifiedcontainer.
-