HHH-9126 Support new functions in PostgreSQL 9.4

This commit is contained in:
Matthias Kurz 2014-04-16 02:26:44 +02:00 committed by Brett Meyer
parent b9dc1e3d48
commit 924fce2c86
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2014, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.dialect;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.type.StandardBasicTypes;
/**
* An SQL dialect for Postgres 9.4 and later. Adds support for various date and time functions
*
* @author edalquist
*/
public class PostgreSQL94Dialect extends PostgreSQL9Dialect {
/**
* Constructs a PostgreSQL94Dialect
*/
public PostgreSQL94Dialect() {
super();
registerFunction( "make_interval", new StandardSQLFunction("make_interval", StandardBasicTypes.TIMESTAMP) );
registerFunction( "make_timestamp", new StandardSQLFunction("make_timestamp", StandardBasicTypes.TIMESTAMP) );
registerFunction( "make_timestamptz", new StandardSQLFunction("make_timestamptz", StandardBasicTypes.TIMESTAMP) );
registerFunction( "make_date", new StandardSQLFunction("make_date", StandardBasicTypes.DATE) );
registerFunction( "make_time", new StandardSQLFunction("make_time", StandardBasicTypes.TIME) );
}
}