public class StandardDatabaseConfiguration extends Object implements DatabaseConfiguration
Modifier and Type | Field and Description |
---|---|
static String |
COMMUNOTE_CONNECTION_PROVIDER_CLASS
Name of a System property which can hold the full qualified class name of a
org.hibernate.connection.ConnectionProvider
|
Constructor and Description |
---|
StandardDatabaseConfiguration() |
Modifier and Type | Method and Description |
---|---|
String |
getConnectionProviderClassName()
Get the class name of the org.hibernate.connection.ConnectionProvider to use.
|
org.hibernate.dialect.function.SQLFunction |
getDatepartSQLFunction()
Get the SQLFunction that will translate the HQL 'datepart' function to SQL.
|
String |
getFulltextParameterValue(String pattern,
org.hibernate.criterion.MatchMode matchMode)
Get the (database specific) parameter value for the given pattern
|
String |
getFulltextParameterValue(String pattern,
org.hibernate.criterion.MatchMode matchMode,
boolean doNotUseFulltext)
Get the (database specific) parameter value for the given pattern
|
org.hibernate.dialect.function.SQLFunction |
getFulltextSQLFunction()
Return the SQL function that translates the HQL 'fulltext' function to SQL.
|
boolean |
isExtendSubselectsWithOuterConditions()
Determine if subselects should be extended by using conditions of the outer clause.
|
boolean |
isUseFulltextFeature() |
public static final String COMMUNOTE_CONNECTION_PROVIDER_CLASS
public String getConnectionProviderClassName()
getConnectionProviderClassName
in interface DatabaseConfiguration
public org.hibernate.dialect.function.SQLFunction getDatepartSQLFunction()
DatabaseConfiguration
Usage: day_of_date(dateField, alias)
where dateField must be one of the
DateField
constants
Example in HQL to return the year of the publication date of a note:
"date_part(" + DateField.YEAR + ", note.publication_date)"
getDatepartSQLFunction
in interface DatabaseConfiguration
public String getFulltextParameterValue(String pattern, org.hibernate.criterion.MatchMode matchMode, boolean doNotUseFulltext)
getFulltextParameterValue
in interface DatabaseConfiguration
pattern
- the patternmatchMode
- the hibernate match modedoNotUseFulltext
- true if the parameter should use the like wildcards matching even if fulltext is
enabledpublic final String getFulltextParameterValue(String pattern, org.hibernate.criterion.MatchMode matchMode)
getFulltextParameterValue
in interface DatabaseConfiguration
pattern
- the patternmatchMode
- the hibernate match modepublic org.hibernate.dialect.function.SQLFunction getFulltextSQLFunction()
The HQL 'fulltext' function takes two arguments: The field to be search and the string to
search for. In HQL the fulltext function has always to be matched against 1, e.g.
fulltext(content.content, 'mysearch') = 1
. BUT if you want the negation use:
not (fulltext(content.content,'mysearch'))
When building queries with the HQL fulltext function always use the
DatabaseConfiguration.getFulltextParameterValue(String, MatchMode)
to set the parameter values because the
syntax differs per database
getFulltextSQLFunction
in interface DatabaseConfiguration
public boolean isExtendSubselectsWithOuterConditions()
DatabaseConfiguration
See the MSSQL Implementation for an example.
isExtendSubselectsWithOuterConditions
in interface DatabaseConfiguration
public boolean isUseFulltextFeature()
isUseFulltextFeature
in interface DatabaseConfiguration
Copyright © 2019 Communote team. All rights reserved.