Package org.openbravo.client.kernel
Class PgFullTextSearchFunction
- java.lang.Object
-
- org.openbravo.client.kernel.PgFullTextSearchFunction
-
- All Implemented Interfaces:
org.hibernate.dialect.function.SQLFunction
- Direct Known Subclasses:
PgFullTextSearchFunction.Filter
,PgFullTextSearchFunction.Rank
public abstract class PgFullTextSearchFunction extends Object implements org.hibernate.dialect.function.SQLFunction
HQL functions to support Full Text Search in PostgreSQL. See each class for more specific documentation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PgFullTextSearchFunction.Filter
It allows to add a where clause to filter by those values that fit the search.static class
PgFullTextSearchFunction.Rank
It allows to add an order by clause regarding how fitting a text is according to the values in the tsvector column.
-
Constructor Summary
Constructors Constructor Description PgFullTextSearchFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract String
getFragment(String table, String field, String value, Optional<String> ftsConfiguration)
protected String
getFtsConfig(Optional<String> ftsConfiguration)
boolean
hasArguments()
boolean
hasParenthesesIfNoArguments()
String
render(org.hibernate.type.Type type, List args, org.hibernate.engine.spi.SessionFactoryImplementor factory)
Function that parses the HQL function to SQL language:
-
-
-
Method Detail
-
getFragment
protected abstract String getFragment(String table, String field, String value, Optional<String> ftsConfiguration)
-
hasArguments
public boolean hasArguments()
- Specified by:
hasArguments
in interfaceorg.hibernate.dialect.function.SQLFunction
-
hasParenthesesIfNoArguments
public boolean hasParenthesesIfNoArguments()
- Specified by:
hasParenthesesIfNoArguments
in interfaceorg.hibernate.dialect.function.SQLFunction
-
render
public String render(org.hibernate.type.Type type, List args, org.hibernate.engine.spi.SessionFactoryImplementor factory)
Function that parses the HQL function to SQL language:- Specified by:
render
in interfaceorg.hibernate.dialect.function.SQLFunction
- Parameters:
args
- list of arguments passed to fullTextSearchFilter hbm function- table
- field: tsvector column of table
- ftsconfiguration [optional]: language to pass to to_tsquery function
- value: string to be searched/compared
- Returns:
- hql string to append to an hql query in order to filter/obtain the rank. See examples for each class in each class' doc
-
-