|
149 | 149 | import org.hibernate.tool.schema.spi.SchemaManagementTool; |
150 | 150 | import org.hibernate.tool.schema.spi.TableMigrator; |
151 | 151 | import org.hibernate.type.BasicType; |
152 | | -import org.hibernate.type.BasicTypeRegistry; |
153 | 152 | import org.hibernate.type.SqlTypes; |
154 | 153 | import org.hibernate.type.StandardBasicTypes; |
155 | 154 | import org.hibernate.type.descriptor.WrapperOptions; |
|
230 | 229 | import static org.hibernate.internal.util.StringHelper.isNotEmpty; |
231 | 230 | import static org.hibernate.internal.util.StringHelper.splitAtCommas; |
232 | 231 | import static org.hibernate.internal.util.collections.ArrayHelper.EMPTY_STRING_ARRAY; |
| 232 | +import static org.hibernate.query.sqm.produce.function.FunctionParameterType.STRING; |
| 233 | +import static org.hibernate.query.sqm.produce.function.StandardFunctionReturnTypeResolvers.invariant; |
233 | 234 | import static org.hibernate.sql.ast.internal.NonLockingClauseStrategy.NON_CLAUSE_STRATEGY; |
234 | 235 | import static org.hibernate.type.SqlTypes.ARRAY; |
235 | 236 | import static org.hibernate.type.SqlTypes.BIGINT; |
236 | 237 | import static org.hibernate.type.SqlTypes.BINARY; |
237 | 238 | import static org.hibernate.type.SqlTypes.BLOB; |
238 | | -import static org.hibernate.type.SqlTypes.BOOLEAN; |
239 | 239 | import static org.hibernate.type.SqlTypes.CHAR; |
240 | 240 | import static org.hibernate.type.SqlTypes.CLOB; |
241 | 241 | import static org.hibernate.type.SqlTypes.DATE; |
|
269 | 269 | import static org.hibernate.type.SqlTypes.isNumericOrDecimal; |
270 | 270 | import static org.hibernate.type.SqlTypes.isVarbinaryType; |
271 | 271 | import static org.hibernate.type.SqlTypes.isVarcharType; |
| 272 | +import static org.hibernate.type.StandardBasicTypes.BOOLEAN; |
272 | 273 | import static org.hibernate.type.descriptor.DateTimeUtils.JDBC_ESCAPE_END; |
273 | 274 | import static org.hibernate.type.descriptor.DateTimeUtils.JDBC_ESCAPE_START_DATE; |
274 | 275 | import static org.hibernate.type.descriptor.DateTimeUtils.JDBC_ESCAPE_START_TIME; |
@@ -434,7 +435,7 @@ protected void initDefaultProperties() { |
434 | 435 | protected void registerColumnTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) { |
435 | 436 | final DdlTypeRegistry ddlTypeRegistry = typeContributions.getTypeConfiguration().getDdlTypeRegistry(); |
436 | 437 |
|
437 | | - ddlTypeRegistry.addDescriptor( simpleSqlType( BOOLEAN ) ); |
| 438 | + ddlTypeRegistry.addDescriptor( simpleSqlType( SqlTypes.BOOLEAN ) ); |
438 | 439 |
|
439 | 440 | ddlTypeRegistry.addDescriptor( simpleSqlType( TINYINT ) ); |
440 | 441 | ddlTypeRegistry.addDescriptor( simpleSqlType( SMALLINT ) ); |
@@ -575,7 +576,7 @@ protected String columnType(int sqlTypeCode) { |
575 | 576 | return switch (sqlTypeCode) { |
576 | 577 | case ROWID -> "rowid"; |
577 | 578 |
|
578 | | - case BOOLEAN -> "boolean"; |
| 579 | + case SqlTypes.BOOLEAN -> "boolean"; |
579 | 580 |
|
580 | 581 | case TINYINT -> "tinyint"; |
581 | 582 | case SMALLINT -> "smallint"; |
@@ -1374,6 +1375,11 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio |
1374 | 1375 | functionRegistry.registerAlternateKey( "current_instant", "instant" ); //deprecated legacy! |
1375 | 1376 |
|
1376 | 1377 | functionRegistry.register( "sql", new SqlFunction() ); |
| 1378 | + |
| 1379 | + functionRegistry.namedDescriptorBuilder( "regexp_like" ) |
| 1380 | + .setParameterTypes( STRING, STRING ) |
| 1381 | + .setReturnTypeResolver( invariant( basicTypeRegistry.resolve( BOOLEAN ) ) ) |
| 1382 | + .register(); |
1377 | 1383 | } |
1378 | 1384 |
|
1379 | 1385 | /** |
|
0 commit comments