Skip to content

Commit

Permalink
Dependencies: Hibernate Community Dialects
Browse files Browse the repository at this point in the history
- recognize OracleLegacyDialect as an Oracle dialect
  • Loading branch information
tomas-muller committed Dec 19, 2024
1 parent a453d42 commit b5603bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions JavaSource/dbupdate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<dialect type="plsql">org.hibernate.dialect.OracleDialect</dialect>
<dialect type="plsql">org.hibernate.dialect.Oracle12cDialect</dialect>
<dialect type="plsql">org.hibernate.dialect.Oracle10gDialect</dialect>
<dialect type="plsql">org.hibernate.community.dialect.OracleLegacyDialect</dialect>
<dialect type="plsql">org.unitime.commons.hibernate.util.OracleDialectLegacyLimitQueries</dialect>
<dialect type="pgsql">org.hibernate.dialect.PostgreSQLDialect</dialect>
<dialect type="pgsql">org.hibernate.dialect.PostgreSQL10Dialect</dialect>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.hibernate.boot.cfgxml.spi.MappingReference.Type;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl;
import org.hibernate.community.dialect.OracleLegacyDialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.dialect.PostgreSQLDialect;
Expand Down Expand Up @@ -441,7 +442,7 @@ public static boolean isMySQL() {
}

public static boolean isOracle() {
return OracleDialect.class.isAssignableFrom(getDialect());
return OracleDialect.class.isAssignableFrom(getDialect()) || OracleLegacyDialect.class.isAssignableFrom(getDialect());
}

public static boolean isPostgress() {
Expand Down Expand Up @@ -472,7 +473,8 @@ public static void addOperations(MetadataBuilder builder, Class dialect) {
builder.applySqlFunction("adddate", PostgreSQLAddDateFunction.INSTANCE);
builder.applySqlFunction("days", PostgreSQLDaysFunction.INSTANCE);
builder.applySqlFunction("weekday", PostgreSQLWeekdayFunction.INSTANCE);
} else if (OracleDialect.class.isAssignableFrom(dialect)) {
} else if (OracleDialect.class.isAssignableFrom(dialect) ||
OracleLegacyDialect.class.isAssignableFrom(dialect)) {
builder.applySqlFunction("weekday", OracleWeekdayFunction.INSTANCE);
builder.applySqlFunction("days", OracleDaysFunction.INSTANCE);
builder.applySqlFunction("adddate", OracleAddDateFunction.INSTANCE);
Expand Down

0 comments on commit b5603bb

Please sign in to comment.