mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-07 11:48:18 +00:00
use localtime/localtimestamp on HSQL and Postgres
Since we don't need the TIME ZONE for our current_time and current_timestamp functions, these are cleaner mappings to SQL for these functions.
This commit is contained in:
parent
fbba9ed4a8
commit
0ecb05614f
@ -212,6 +212,21 @@ public void initializeFunctionRegistry(QueryEngine queryEngine) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String currentTime() {
|
||||
return "localtime";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String currentTimestamp() {
|
||||
return "localtimestamp";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String currentTimestampWithTimeZone() {
|
||||
return "current_timestamp";
|
||||
}
|
||||
|
||||
@Override
|
||||
public SqlAstTranslatorFactory getSqlAstTranslatorFactory() {
|
||||
return new StandardSqlAstTranslatorFactory() {
|
||||
|
@ -122,6 +122,21 @@ public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String currentTime() {
|
||||
return "localtime";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String currentTimestamp() {
|
||||
return "localtimestamp";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String currentTimestampWithTimeZone() {
|
||||
return "current_timestamp";
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@code extract()} function returns {@link TemporalUnit#DAY_OF_WEEK}
|
||||
* numbered from 0 to 6. This isn't consistent with what most other
|
||||
|
Loading…
x
Reference in New Issue
Block a user