Commit Graph

375 Commits

Author SHA1 Message Date
Gavin c6f0be990c yet more work on the API documentation
- and get rid of people's email addresses, they don't belong in the code
2022-12-29 15:03:09 +01:00
Gavin 2355f98586 HHH-14526 tolerate dupe tables in JOINED inheritance with discriminator
and also support @DiscriminatorOptions for JOINED inheritance
2022-12-26 18:22:06 +01:00
Christian Beikov 4901d2bb61 HHH-15464 Allow JdbcType to expose the type code to use for DDL 2022-12-22 17:25:13 +01:00
Christian Beikov a094d4c5d5 HHH-15463 Adjust JdbcType based on DDL capacity for varchar/varbinary like types 2022-12-22 17:25:13 +01:00
Gavin 023e73cb46 promote trunc() / truncate() to the list of standard HQL functions
also support the single-argument form of round() for consistency
2022-12-21 14:25:35 +01:00
Marco Belladelli d862f2d52e HHH-15868 Fix db2's atan2 function requiring inverted argument order 2022-12-21 13:38:43 +01:00
Christian Beikov 7007bafe55 HHH-15872 Add ColumnOrderingStrategy SPI and handle record structs specially 2022-12-20 20:17:23 +01:00
Andrea Boriero 1f630e4a5d HHH-15805 Subquery with where condition on a column with columnDefinition results in wrong SQL grammer 2022-12-20 18:55:17 +01:00
Gavin 679ed3bbee add select generator test for Postgres, MySQL, EDB 2022-12-20 01:38:55 +01:00
Marco Belladelli 8bbb1edb30 Fix some failing tests 2022-12-16 16:18:08 +01:00
Marco Belladelli fc7bdce2c8 HHH-15736 Add escape logic to cockroach and fix mysql 5.7 2022-12-15 12:14:39 +01:00
Sanne Grinovero cacba9a205 HHH-15867 Avoid runtime services lookup for JdbcServices and BatchBuilder 2022-12-14 21:48:06 +00:00
Christian Beikov bc36eb3eeb HHH-15327 Support mapping aggregate embeddables as struct/json 2022-12-14 19:02:43 +01:00
Marco Belladelli f1b9909fb6 HHH-15736 Handle backslash escapes in like patterns 2022-12-14 17:25:16 +01:00
Christian Beikov dfa3981a52 Make stored procedure and function calls through ProcedureCall API more portable 2022-12-14 11:21:06 +01:00
Christian Beikov 371d2f1d49 Move getCheckCondition to BasicType and add variant to JdbcType for Oracle Booleans and other future uses 2022-12-12 20:13:52 +01:00
Christian Beikov a9be2e1584 Fix temporal round in tests and render calendar with milliseconds precision 2022-12-08 16:15:40 +01:00
Karel Maesen 7a1f2542c1 HHH-15814 add methods for current time selection to CockroachLegacy Dialect 2022-12-07 22:35:53 +01:00
Mark Rotteveel 9290f8b754 HHH-15812 Firebird dialect improvements 2022-12-06 11:38:51 +01:00
Sanne Grinovero 329ccaa7a1 HHH-15791 Avoid excessive Session casts to EventSource 2022-12-02 09:40:53 +00:00
Marco Belladelli be9358e02f HHH-15785 Fix javadoc errors 2022-12-01 14:51:28 +01:00
Steve Ebersole a9ac98b364 HHH-15393 - Improve write-paths to use mapping model
HHH-15723 - Fix foreign-key modeling
2022-11-28 14:25:40 -06:00
Gavin 12aa8bd431 add some comments for the next poor soul who wrestles with unique constraints 2022-11-27 12:38:45 +01:00
Gavin 5172d8798f HHH-15762 work around weird semantics of null in unique index on DB2/T-SQL 2022-11-27 02:14:38 +01:00
Gavin 3ba90c004c HHH-15762 nicer DDL for unique constraints
- prefer 'unique' in 'create table' except in migrations
- also ignore unique=true for PK column
- introduce AlterTableUniqueDelegate and CreateTableUniqueDelegate
- fix the tests / delete test that makes no sense now
- improve javadoc of UniqueDelegate
2022-11-26 13:40:40 +01:00
Marco Belladelli 9c0b30f99d HHH-15760 various small html fixes javadoc 2022-11-26 09:49:56 +01:00
Marco Belladelli f38dd28043 HHH-15760 mass replace self-closing tags in javadoc 2022-11-26 09:49:56 +01:00
Christian Beikov 276b7a6f95 HHH-15748 Use JSON DDL type on Oracle 21+ and BLOB on 12+ 2022-11-25 10:11:12 +01:00
Christian Beikov 67d751d81d Cleanup embeddable expression handling and resolving of column references 2022-11-23 20:44:33 +01:00
Christian Beikov 4914d14a43 HHH-15626 Move old databases to nightly pipeline and add some SQL Server 2022 features 2022-11-18 11:06:39 +01:00
Christian Beikov 90a752a0ee HHH-15328 Add support for CTE WITH clause 2022-11-10 13:25:21 +01:00
Gavin King 61c128000b HHH-15672 introduce Generated(UPDATE) for properties only generated on update 2022-11-08 12:36:38 +01:00
Gavin King bb0541d754 remove more usages of some deprecated methods 2022-10-29 23:32:05 +02:00
Christian Beikov 940f15b63e HHH-15528 Add Cockroach to Jenkins nightly test matrix and fix issues 2022-10-21 09:51:16 +02:00
Jan Schatteman 0baefce734 HHH-15561 - Fixed and added test for issue
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-10-14 23:26:16 +02:00
Christian Beikov f13230803d HHH-15590 Test that JdbcLiteralFormatter works for all supported java types 2022-10-13 15:21:51 +02:00
Christian Beikov 6b6cd51edf HHH-15592 Fix NPE for uses of JdbcExceptionHelper.extractSqlState 2022-10-12 15:48:20 +02:00
Gavin King f5a5990d03 try to make var_xxx() and sdtev_xxx() more portable 2022-10-08 21:27:43 +02:00
Gavin King 477f1e7af6 HHH-15588 promote sinh(), cosh(), and tanh() 2022-10-08 18:58:42 +02:00
Gavin King 20b905507f HHH-15584 use count_big() on Sybase and SQL Server 2022-10-07 17:03:37 +02:00
Christian Beikov fa89e3e5fa HHH-15531 Use dense_rank instead of row_number when query uses distinct 2022-10-06 08:37:15 +02:00
Christian Beikov 5f2d5e3938 HHH-15578 Add min/max emulation for uuid on PostgreSQL 2022-10-05 11:44:52 +02:00
Christian Beikov 12df6317ec HHH-15548 Fix schema validation issues on PostgreSQL with Instant type 2022-10-04 16:21:58 +02:00
Gavin King 6e94b35ee1 HHH-15549 remove mapping of NUMBER(1,0) to BOOLEAN on Oracle
This just seems wrong to me. We have no way to say that a NUMBER(1,0)
column isn't a single-digit number.

Simplify the other mappings for NUMBER(n,0).
2022-10-02 12:12:33 +02:00
Gavin King 04302caba0 fix SqlTypes.LONG32VARXXXX types and add a test
also fix a bug in initialization of JdbcTypeFamilyInformation

fix incorrect mapping for "long" types on Derby

use default for nicer-looking switch statements

improve some Javadoc
2022-10-01 12:57:30 +02:00
Jan Schatteman bb5aa62927 HHH-15487 - Remove support for PostgreSQL versions older than 10
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-21 19:57:32 +02:00
Jan Schatteman 89a98f2dc7 HHH-15489 - Remove support for Oracle versions older than 11.2
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-21 17:52:03 +02:00
Jan Schatteman 4f9ff5cfd1 HHH-15511 - fix version determination also for the CockroachDB legacy dialect
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-20 17:59:17 +02:00
Jan Schatteman e0e85c3398 HHH-15490 - Remove support for HSQLDB versions older than 2.6.1
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-20 08:58:37 +02:00
Gavin King 7740121449 clean up old code + deprecate LockOptions.getAliasLockIterator() 2022-09-16 13:21:44 +02:00
Jan Schatteman 3dec1ca4dc HHH-15447 - Remove references to deprecated dialects
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-12 16:05:00 +02:00
Jan Schatteman ec49356c77 HHH-15181 / HHH-15197 / HHH-15198
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-07 17:00:57 +02:00
Jan Schatteman 11fb9440ef HHH-15192 - Remove support for Sybase ASE versions older than 16
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-07 16:51:57 +02:00
Jan Schatteman 17fa97d1b0 HHH-15182 - Remove support for MariaDB versions older than 10.3
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-06 15:04:04 +02:00
Jan Schatteman 5b0b1fa680 HHH-15179 - Move support for MySQL versions older than 5.7 into community dialects
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-06 15:04:04 +02:00
Jan Schatteman 429ab5b936 HHH-15180 - Remove support for SQL Server versions older than 2008
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-06 14:49:45 +02:00
Jan Schatteman 75f4c95274 HHH-15195 - Moving support for CockroachDB versions older than 21.1 into community dialects
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-06 14:48:04 +02:00
Jan Schatteman f33d3ed308 HHH-15190 - Remove support for H2 versions older than 1.4.197
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-06 14:45:37 +02:00
Jan Schatteman 4d4aaf3b4a HHH-15191 - Remove support for Derby versions older than 10.14.2.0
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2022-09-05 10:06:41 +02:00
Christian Beikov 271cba0603 HHH-15461 Replace uses of method references for SqlAppender with proper implementation 2022-08-25 09:43:48 +02:00
Sanne Grinovero e6fdafc393 HHH-15408 QueryEngine to be more defensive with passed parameters 2022-07-20 21:58:15 +01:00
Christian Beikov a9d1035806 Do some renaming for consistency and update documentation for new SQL types 2022-03-29 19:31:53 +02:00
Christian Beikov 063a13c8a3 Get rid of some NotYetImplementedFor6Exception uses 2022-03-29 14:03:49 +02:00
Christian Beikov fa750a9c26 Make LONGX types synonyms for X types again and remove unnecessary case labels 2022-03-08 21:59:49 +01:00
Christian Beikov 2c80250b0e Replace typeNames in Dialect with SqlType and SqlTypeRegistry that dialects contribute into 2022-03-08 21:59:49 +01:00
Christian Beikov e9b3066f93 Add sql type name and size information to selectable mapping 2022-03-03 10:34:26 +01:00
Christian Beikov dc6ad33cfc HHH-10463 Implement function argument type inference 2022-02-15 09:04:50 +01:00
Christian Beikov 5828536428 Implement window function support in HQL 2022-02-09 18:32:27 +01:00
Gavin King d0255d2c2b make CommonFunctionFactory a real object 2022-02-01 18:21:55 +01:00
Christian Beikov 0509b10040 Implement support for ordered set-aggregate functions like listagg, percentile_disc, rank etc. 2022-02-01 13:38:32 +01:00
Christian Beikov af42f3a76c Allow controlling whether selection item deduplication should happen and disable deduplication in subqueries. Remove some dead code and fix a possible NPE. Expose some JdbcOperation fields for libraries to make it easy to produce a derived operation. 2022-01-31 16:55:59 +01:00
Andrea Boriero b9d4a74693 Fix rendering of negated boolean expression predicate 2022-01-26 13:52:12 -06:00
Steve Ebersole 7b00d3ce78 Migrate internal uses of `MetamodelImplementor` (deprecated) to instead use `MappingMetamodel` 2022-01-25 20:22:29 -06:00
Gavin King e51c210d78 squash lots of warnings in services
change the raw Map representation of config properties to Map<String,Object>
2022-01-25 21:04:50 +01:00
Steve Ebersole 2b5a5fc196 api, spi, internal, deprecation
org.hibernate.query package
2022-01-21 13:27:11 -06:00
Gavin King 329b2fc9c4 remove hibernate.jdbc.use_streams_for_binary config property
this should be handled by the Dialects
2022-01-21 16:52:09 +01:00
Christian Beikov 445cedfec7 Cleanup the naming of JavaDescriptor and JavaTypeDescriptor to align with the new naming JavaType 2022-01-20 16:01:02 +01:00
Christian Beikov c284315931 Add validation for format function and remove `aa` format as no database supports long/short AM/PM markers 2022-01-18 15:18:01 +01:00
Andrea Boriero b8fab567cc Fix CriteriaBuidler#locate() arguments order rendering 2022-01-18 13:10:24 +01:00
Andrea Boriero 9e7a091d67 Fix CriteriaBuidler#locate() arguments order rendering 2022-01-17 18:39:01 +01:00
Steve Ebersole 9fe3c861ca HHH-15023 - Move Query and NativeQuery back to org.hibernate.query 2022-01-14 14:49:17 -06:00
Steve Ebersole fda6e96c5e HHH-15023 - Move Query and NativeQuery back to org.hibernate 2022-01-11 21:01:56 -06:00
Gavin King aef951f279 move some function arg typechecking up to the SQM phase
this is where it needs to be for checking of named queries at startup
and for any checks that happen in an IDE or at build time
2022-01-06 18:10:00 +01:00
Gavin King cc91beb536 typecheck HQL function arguments 2022-01-06 18:10:00 +01:00
Gavin King 8adc1d8d70 use @code instead of <tt> in Javadoc 2021-12-27 07:31:15 -06:00
Christian Beikov aec5ce9d8a Move some more tests and fix H2 tuple comparison issues 2021-12-23 18:51:13 +01:00
Christian Beikov fb30206387 Add emulation for simple lateral joins and make use of lateral joins for min/max index/element paths if possible 2021-12-18 05:12:36 -06:00
Christian Beikov 1988ffa310 Support lateral joins by introducing a lateral flag in TableGroupJoin and add a FunctionTableReference for table valued functions 2021-12-18 05:12:36 -06:00
Christian Beikov b75277b421 Split TableReference class into interface and NamedTableReference implementation to allow QueryPartTableReference and ValuesTableReference to fit into the picture 2021-12-18 05:12:36 -06:00
Gavin King bc65526c77 clean up the Dialect-specific default property handling 2021-12-16 15:58:47 +01:00
Gavin King e992b41756 clean up constructor model in Dialects
and fix strange model of versions on Maria/TiDB
2021-12-14 22:54:27 +01:00
Gavin King e2be0960fd let's not use LONGVARCHAR to mean two different things 2021-12-14 22:54:27 +01:00
Gavin King eb3bcdb94a reworked approach to Dialect column type customization 2021-12-14 22:54:27 +01:00
Christian Beikov 09d859fd3c Re-enable all community dialect tests 2021-12-14 13:00:14 +01:00
Christian Beikov eecda61ceb Move more tests and fix subselect support 2021-12-14 13:00:14 +01:00
Gavin King ccc88e9ad4 update the community dialects 2021-12-11 21:27:01 +01:00
Gavin 0ca7a659b0 "long" varchar/varbinary mappings
add Length class with useful constant values
well-defined mappings for "long" varchar/varbinary types
make LONGVARCHAR a synonym for VARCHAR with length=LONG32
make LONGVARBINARY a synonym for VARBINARY with length=LONG32
add Dialect.getMaxVarcharLength() + friends
make schema validator ignore the differences between string types
2021-12-11 21:27:01 +01:00
Steve Ebersole 7a6cef5838 Miscellaneous
- Finished DialectVersion
- User Guide tidying
- User Guide section on AttributeBinder
2021-12-09 00:51:40 -06:00
Steve Ebersole 942dd7283f DialectVersion
- rename `#isSince` to `#isSameOrAfter`
2021-12-08 15:54:50 -06:00
Steve Ebersole 10d759e139 Dialect version 2021-12-08 15:36:48 -06:00
Christian Beikov 6c4ec95182 * Cleanup temporary table handling in dialects
* Fix insert handling with respect to version, discriminator and generated identifier insertion
* Introduce SqmMultiTableInsertStrategy to handle multi-table inserts
* Introduce the notion of an "entity table" similar to the "id table" to handle multi-table insertions
* Implement table based and cte based multi-table insertion to support all dialects
* Implement identifier generator optimizer support for multi-table insert
* Fix validation of insert target paths against select item types
* Fix some DML validations
* Implement over-clause support in SQL AST
* Fix multi-valued filter parameter support
2021-12-07 15:54:01 +01:00
Yoann Rodière 495bd51caa HHH-14921 Always use SqlStringGenerationContext for generation of SQL strings involving table/sequence names 2021-12-07 08:25:50 +01:00
Christian Beikov cbcec73d4f * Handle quoted identifiers in HQL and the Ordering parser
* Switch from the "expression" to "expressionOrPredicate" rule in the HQL grammar where it makes sense as required by some HQL tests
* Cleanup parser rule ordering to allow more keywords in the identifier rule
* Implement literal support for Ordering parser
* Add special AvgFunction as needed by H2, HSQL, DB2, SQL Server and Sybase that casts arguments to double if necessary
* Fix wrong deduplication of order by fragments in case a plural attribute is fetched multiple times
* Implement support for de-referencing any-valued mappings in HQL
* Avoid unnecessary entity subtypes in polymorphic splitted queries if a base type also matches the requested type
* Implement pagination support for polymorphic splitted queries
* Cleanup path part resolving by removing lots of duplicate code
* Aligh HQL parsing expectations to the expected behavior of 5.x
* Add method to `JavaType` that allows determining if a type is can be widened to another which is used for arithmetic type resolving
* Implement validations for fetch owner checking
* Fix issues with the id table creation due to lacking column lengths in the column DDL type
* Fix issues and add some optimizations related to multi-table delete handling
* Add the notion of a special "implicit" alias to avoid generating a unique alias for unaliased or implicit HQL joins
* Properly implement multiple bag fetch validation
* Make sure filter predicates are applied for all plural attribute joins
* Fix some issues with undecidable parameter type inference
* Fix some issues with negated SQM predicates not being converted to the proper SQL AST predicates
* Fix issues with qualifying DML target referencing columns
* Fix `is null` semantics for tuples referring to embeddable types
* Capture necessary details from JdbcValuesMetadata in the cached data to avoid executing a query on cache hit when types should be inferred
* Get rid of special CollectionPropertyNames and writeup a migration guide section for the replacements
2021-11-25 08:51:51 +01:00
Steve Ebersole 0925e48ebf more user-guide basic-type chapter work;
renamed `JavaTypeDescriptorRegistry` to `JavaTypeRegistry`;
renamed `JdbcTypeDescriptorRegistry` to `JdbcTypeRegistry`
2021-10-25 13:55:53 -05:00
bb7133 5bd27eb853 HHH-14576 : Introduce the dialect for TiDB 2021-10-20 16:19:22 +02:00
Christian Beikov 98de63d0a1 Handle keywords initialization for dialects through DialectResolutionInfo and un-deprecate Dialect#getKeywords 2021-10-20 15:02:48 +02:00
Christian Beikov a4e406a54e * Add SqlTypes as analogy to java.sql.Types containing constants for Hibernate specified types
* Add FormatMapper for a pluggable JSON serialization and deserialization strategy
* Add native UUID type support for H2, Cockroach, PostgreSQL
* Add native INET type support for Cockroach, PostgreSQL
* Add native JSON type support for MySQL, Cockroach, PostgreSQL
* Add native INTERVAL SECOND type support for H2, Cockroach, PostgreSQL
* Add fallback JdbcTypes for new SqlTypes
* Register column types for new SqlTypes
* Add support for BasicTypeReference in TypedParameterValue
* Fix a lot of method signatures with respect to type parameter issues
* Fix CustomType, UserType and EnhancedUserType with respect to type parameters
* Get rid of StringRepresentableType and some other unused deprecated methods
2021-10-19 16:33:36 +02:00
Steve Ebersole 686d8fcbf1 HHH-14870 - Rename {Xyz}TypeDescriptor as {Xyz}Type
* `JavaTypeDescriptor` -> `JavaType`
* `JdbcTypeDescriptor` -> `JdbcType`
2021-10-11 13:13:13 -05:00
Steve Ebersole 3a0065eea4 HHH-14870 - Rename {Xyz}TypeDescriptor as {Xyz}Type
* `JavaTypeDescriptor` -> `JavaType`
* `JdbcTypeDescriptor` -> `JdbcType`
2021-10-11 13:11:32 -05:00
Christian Beikov 548df627e6 Implement global configuration and sketch out annotations for time zone storage configuration. Move type tests and add skips for some tests running into H2 bugs. Also, fix some jdbc type assertion tests 2021-10-11 16:11:46 +02:00
Christian Beikov 597f4bdf6a Get rid of JdbcTypeDescriptor remapping 2021-10-11 16:11:46 +02:00
Christian Beikov 710ebe57b0 Get rid of using specialized BasicType implementations and references to those and instead use a BasicTypeReference that is lazily resolved 2021-10-07 08:15:53 +02:00
Christian Beikov 1cb6ff8916 Cleanup naming of JavaTypeDescriptor and JdbcTypeDescriptor implementations. Get rid of PrimitiveType, IdentifierType, DiscriminatorType and AllowableTemporalParameterType 2021-10-07 08:15:53 +02:00
Christian Beikov 40ccad1db2 Get rid of deprecated dialect methods, JoinFragment, LegacyLimitHandler, LegacySequenceSupport, CaseFragment, SelectFragment etc. 2021-10-05 15:18:38 +02:00
Christian Beikov f416b728a9 Get rid of RowSelection, QueryParameters and related deprecated functionality 2021-10-05 15:18:38 +02:00
Christian Beikov c5baae7e11 Improve SQL rendering performance by avoiding intermediate String objects 2021-10-05 15:18:38 +02:00
Christian Beikov d8b984ed7f Fix some column type definitions in dialects regarding their maximum capacities. Allow the dialect to resolve the length based on type code, type name, precision, scale and display size. Fix some dialect related issues with tests. Fix untyped null parameter binding issues 2021-09-30 13:52:31 +02:00
Christian Beikov 05f643f208 Move some more jpa.test subpackages to orm.test 2021-09-30 13:52:31 +02:00
Steve Ebersole 089a3f86ae HHH-14837 - Move to Jakarta EE
preliminary transformation;
only `javax.persistence.*` settings supported atm
2021-09-27 08:21:27 -05:00
Andrea Boriero 573d146046 Removed Dialect#areStringComparisonsCaseInsensitive() method 2021-09-25 11:52:03 +02:00
Christian Beikov 77c1370e45 HHH-14642, HHH-13717 Various JPA Criteria related fixes
* Get rid of unnecessary whitespace and optional keywords in generated SQL
* Handle some type inference related issues with some databases requiring to render casted parameters in some situations
* Ensure SQM model is fully serializable
* Ensure JPA Criteria throws expected exceptions
* Make sure JPA Criteria implementations work properly
* Move jpa.test.callback and jpa.test.criteria packages
* Improve the reuse of SqmPath instances
* Get rid of many raw-types related warnings
* Make Predicate extend Expression and handle SQL rendering/emulation
* Support fetching SqmTuple as array
* Implement treat operator support
2021-09-09 16:39:31 +02:00
Andrea Boriero 94a258c8d7 Fix wrong creation of inner join 2021-07-08 14:09:46 +02:00
Andrea Boriero 241300c0c1 Fix wrong creation of inner join 2021-07-08 14:09:46 +02:00
Andrea Boriero 8895347867 Fix null dicriminator unable to cast MarkerObject to ... 2021-07-08 11:48:54 +02:00
Christian Beikov 6447ca9b26 HHH-14693, HHH-10668 Move non-supported dialects to the hibernate-community-dialects artifact and add the SQLite dialect originally contributed by Vlad Mihalcea which was adapted for Hibernate 6. Also add HSQLDB, MySQL and Sybase ASE configurations and a CI job config 2021-07-06 10:14:20 +02:00