HHH-9602 - added new dialect for PostgreSQL 9.3 that supports materialized views & enable materialized view support.

This commit is contained in:
dionis 2015-02-06 12:48:46 +02:00 committed by Steve Ebersole
parent 43a62ad477
commit 8235721747
2 changed files with 38 additions and 0 deletions

View File

@ -733,7 +733,27 @@ public abstract class Dialect implements ConversionContext {
return SequenceStyleGenerator.class;
}
}
// Materialized view support
/**
* Does the dialect support materialized view. It's needed for schema validation purposes.
* @return True if dialect supports materialized views. False otherwise.
*/
public boolean supportsMaterializedView() {
return false;
}
/**
* Does the dialect support materialized view. It's needed for schema validation purposes.
* @return Query string that will be passed as one of {@code String[] types} parameter
* to {@link java.sql.DatabaseMetaData#getTables(String, String, String, String[])}. {@code null}
* otherwise if dialect is not supported or doesn't need to use explicit type term.
*/
public String getMaterializedViewTypeTerm() {
return null;
}
// End of Materialized view support
// IDENTITY support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -0,0 +1,18 @@
package org.hibernate.dialect;
/**
* An SQL Dialect for PostgreSQL 9.3 and later. Adds support for Materialized view.
*
* @author Dionis Argiri
*/
public class PostgreSQL93Dialect extends PostgreSQL9Dialect {
@Override
public boolean supportsMaterializedView() {
return true;
}
@Override
public String getMaterializedViewTypeTerm() {
return "MATERIALIZED VIEW";
}
}