Commit Graph

432 Commits

Author SHA1 Message Date
Christian Beikov 1983123d72 Use a shared connection provider for most tests to reduce test time significantly 2021-02-03 17:03:47 +01:00
Christian Beikov 62d727d44e Fix connection leak in connection provider used for JTA tests 2021-02-03 17:03:47 +01:00
Christian Beikov 08d9fe1a3b Add cleaners for clearing a schema the first time before running a test 2021-02-03 17:03:47 +01:00
Christian Beikov d767d46d05 Fix most tests to work on all DBs and fix a bunch of connection leaks 2021-02-03 17:03:47 +01:00
Steve Ebersole 9849ea5a1f - HHH-14409 : Internal format of natural-id values
- org.hibernate.loader.access
- `ModelPart.breakDownJdbcValues`
- build/keep natural-id loaders per entity (inheritance)
- changes to NotImplementedYetExtension
- tests
2021-01-27 10:38:20 -06:00
Andrea Boriero 24b79133f2 Created a ClassLoadingIsolaterExtension to remove the need of @Rule in tests using ClassLoadingIsolater 2021-01-25 22:38:53 +01:00
Andrea Boriero e0e44433a9 Fix some issues with tests migration 2021-01-25 18:40:59 +01:00
Andrea Boriero 491cbabc6c Added Junit5 extention to use LoggerInspection without @Rule annotation 2021-01-25 18:40:59 +01:00
Andrea Boriero ac18db61b7 Fix checkstyle error 2021-01-25 18:40:59 +01:00
Andrea Boriero a5d60b3b7e Add @BaseUnitTest annotation and minor changes 2021-01-25 16:20:45 +01:00
Andrea Boriero b761cfddd3 Merge remote-tracking branch 'upstream/master' into wip/6.0 2021-01-20 17:48:43 +01:00
Yoann Rodière d726dcb394 HHH-14326 Test JDBC resources are released before closing the connection
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-20 09:26:51 +00:00
Christian Beikov 4efffca23b Add support for FETCH clause, CTEs and set operations 2021-01-13 17:24:45 +01:00
Jan Schatteman 2e835c47cd New Test annotation @NotImplementedYet
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2020-12-21 19:45:20 +01:00
Steve Ebersole 33358df72b New testing `@Jpa` annotation 2020-12-11 10:24:29 +01:00
Andrea Boriero 7d74f1c727 Fix issue with emneddable id initialization 2020-12-10 17:02:49 +01:00
Andrea Boriero 9a6465a72f Check if auto flush is required for hql queries 2020-12-08 17:01:27 +01:00
Christian Beikov c4673e5a5c Fix a few more test issues and handle group by summarization rendering strategies as well as group by literal rendering strategies 2020-12-08 11:27:27 +01:00
Christian Beikov a57f93b14a Use processing stack during parsing to access query spec, fix lots of db2 issues 2020-12-08 11:27:27 +01:00
Christian Beikov d9446e7c77 Fix a few test issues, implement tuple emulation, group by support and support configuring criteria value handling mode 2020-12-08 11:27:27 +01:00
Andrea Boriero e3947b3b1c Re-enabled additional tests and fix issues with IdClass 2020-11-25 15:15:34 +01:00
Steve Ebersole be654c37b5 HHH-14313 - NaturalId support 2020-11-11 08:27:20 -06:00
Steve Ebersole 4402843d1c Various fixes from Search integration testing
- do not cache Criteria query plans (added Trello card to revisit)
  - support for StatelessSession in JUnit 5 extensions (SessionFactoryScope)
2020-10-30 12:04:52 -05:00
Steve Ebersole 23f64fc675 Various fixes from Search integration testing
- support for mutable converted (AttributeConverter) values
  - bug in EntityType#toLoggableString
2020-10-30 08:32:39 -05:00
Andrea Boriero 9cf4edfbee Merge remote-tracking branch 'upstream/master' into wip/6.0 2020-10-26 08:14:01 +00:00
Sanne Grinovero e3edcdbe55 HHH-10715 More static and final keywords missing 2020-10-25 21:33:23 +00:00
Andrea Boriero 0bd2c32f76 Merge remote-tracking branch 'upstream/master' into wip/6.0 2020-10-02 12:39:41 +01:00
Gavin King cf995a1571 HHH-14217 Add syntax highlighting to the logged SQL
Using ANSI escape codes

Must be explicitly enabled using hibernate.highlight_sql
2020-09-30 16:39:12 +01:00
Andrea Boriero 140fbb45d6 Merge remote-tracking branch 'upstream/master' into wip/6.0 2020-09-22 11:43:55 +01:00
Falko Modler 1cf99c748a HHH-14031 Update h2 to 1.4.197
Notes:
- h2 1.4.197+ does not support ns precision by default anymore
- h2 DateTimeUtils.resetCalendar() is required for many tests to avoid failures due to h2 internal caching
2020-09-09 10:32:21 +01:00
Steve Ebersole 3d46fabeb5 HHH-14191 - ANY mapping support
- `@ManyToAny`
- embeddable sub-attribute
2020-08-27 17:37:28 -05:00
Andrea Boriero 5dfa67bd6f Re-enable additional tests 2020-08-21 07:23:37 +01:00
Andrea Boriero 82de2b0a3f Re-enabled additional tests 2020-08-20 11:58:41 +01:00
Steve Ebersole 2050e366fe ResultSet mapping
- Tests for value conversions - `@Enumerated`, `AttributeConverter`, `@Temporal`.  It worked already
2020-08-13 14:48:48 -05:00
Andrea Boriero 283c3fefb5 Merge remote-tracking branch 'upstream/master' into wip/6.0 2020-08-07 11:23:44 +01:00
Andrea Boriero d246a4b460 fix issue with not compiling tests 2020-07-30 18:40:38 +01:00
Andrea Boriero 798f327f68 Revert "fix issue with not compiling tests"
This reverts commit fc914ea647.
2020-07-30 18:32:38 +01:00
Andrea Boriero fc914ea647 fix issue with not compiling tests 2020-07-30 18:08:35 +01:00
Andrea Boriero 1a6b01a2a8 Add version to @SkipDialect and @RequiresDialect and re-enabled additional tests 2020-07-30 10:26:24 -05:00
Steve Ebersole 704896614d Support for JPA `SqlResultSetMapping`, both in terms of:
- creating memento instances for each mapping and storing into repository for runtime access
- applying to native-queries

Only support for column results is implemented atm since only scalar results are implemented for native-query
2020-07-29 11:58:27 -05:00
Steve Ebersole bbe3a6b0ad NativeQuery support
- parameter handling
2020-07-28 14:09:54 -05:00
Steve Ebersole 2f8f04747b NativeQuery support
- support for `#addScalar(Class,AttributeConverter)`
- support for `#addScalar(Class,Class<AttributeConverter>)`
- fixed problem with mapping of converted enums
2020-07-27 16:49:28 -05:00
Rafi Shamim 4655bdbe12 HHH-13724 Add CockroachDB dialects and configs for testing 2020-07-27 12:49:40 +01:00
Steve Ebersole 5dded5de7c NativeQuery support
- initial working support - simple scalar queries
2020-07-23 12:26:01 -05:00
Nathan Xu 3d4cd3f7b3 port entity graph legacy testing cases 2020-07-20 09:37:15 +01:00
Andrea Boriero 843813cd5a Re-enabled more tests 2020-07-02 12:11:45 +01:00
Andrea Boriero 47eee7cfe4 Re-enabled additional tests 2020-06-26 10:15:46 +01:00
Andrea Boriero 511d4d55cd Add more tests 2020-06-26 10:15:46 +01:00
Nathan Xu 2250b7f84f implement 'NULLS (FIRST | LAST)' in HQL 2020-06-23 10:32:43 -05:00
Nathan Xu bbac6ed571 add a 'reverse' property (default to false) to RequiresDialectFeature annotation 2020-06-23 10:26:40 -05:00
Nathan Xu fdc2112b19 implement @RowId 2020-06-23 10:17:50 -05:00
Andrea Boriero 257e479e92 Merge remote-tracking branch 'upstream/master' into wip/6.0_merge_39 2020-05-14 10:00:59 +01:00
Yoann Rodière f6ebcc5f80 HHH-14006 Support inherited fields in EnhancerTestUtils#getFieldByReflection 2020-05-11 22:15:14 +01:00
Steve Ebersole e38a4de536 Verified and fixed BasicValue resolutions based on type-defs and UserTypes 2020-05-01 11:29:44 -05:00
Steve Ebersole 96f4a350e0 * HBM mappings
* dynamic models
* initial non-aggregated cid support
2020-04-27 15:21:09 -05:00
Andrea Boriero 7f4c25095e Implement Composite Foreign Key for EmbeddedId 2020-04-21 16:44:03 -05:00
Steve Ebersole ced4f5e602 Various changes around how basic values are handled in terms of mapping consumption for annotations and how value conversions happen
* Split BasicType "resolution" into 2 - one used for reading (mapping model) versus one used from writing (legacy persister model)
* @SqlTypeCode, @SqlType, @SqlTypeRegistration
* @JavaType, @JavaTypeRegistration
* @Mutability
* jdbc_mappings.adoc section for DomainModel chapter

[*] At the moment, neither @SqlTypeRegistration nor @JavaTypeRegistration support has been implemented
[*] Still need to make sure @Mutability is propogated properly in all the cases
[*] jdbc_mappings.adoc still needs a lot of attention
2020-04-21 16:09:46 -05:00
Andrea Boriero 299826b9b7 HHH-13937 Get rid of junit5 compile-time dependencies 2020-04-14 14:23:29 +01:00
Andrea Boriero 5d1aea1897 Fix merge checkstyle and compilation errors 2020-04-09 11:07:00 +01:00
Andrea Boriero 5c86c4a805 Merge remote-tracking branch 'upstream/master' into wip/6.0_merge_29 2020-04-09 07:37:11 +01:00
Andrea Boriero b897a36f2f Fix issue with generated pom missing project description 2020-04-06 18:21:11 +01:00
Yoann Rodière bee15c498f HHH-13925 Fix malformed @author tags in javadoc
You're not supposed to use unescaped "<" or ">".

This wasn't detected by checkstyle in Gradle 5, but it is now, and that
fails the build.
2020-04-06 16:04:55 +02:00
Yoann Rodière aebf9d192f HHH-13925 Fix invalid javadoc syntax
This wasn't detected by checkstyle in Gradle 5, but it is now, and that
fails the build.
2020-04-06 16:04:55 +02:00
Nathan Xu 7e2987ac79 HHH-13877 - Make @SortNatural by default 2020-03-19 14:41:05 -05:00
Nathan Xu adc87b7908 various cosmetic code improvements 2020-03-19 13:12:12 -05:00
gavinking 10f333943d tests for HQL insert/update 2020-03-19 13:01:48 -05:00
Nathan Xu 7ee45f68ee wrap up verification for both @SortedSet and @SortedMap 2020-03-09 13:48:46 -05:00
Koen Aers 23f2cc584b Verify array support: add 'EntityOfArrays' case to the GambitDomainModel and the PluralAttributeMappingTests
Signed-off-by: Koen Aers <koen.aers@gmail.com>
2020-03-09 18:23:44 +00:00
The Geeky Asian b914b02dca HHH-13874 - Removing the @author added.
The newly added @author in the previous commit or deprecation messages has been removed in this commit.
2020-02-21 06:11:37 -06:00
The Geeky Asian e98e89d806 HHH-13874 - Messages added for the deprecated methods. 2020-02-21 06:11:37 -06:00
The Geeky Asian c4bd5937e3 HHH-13874 - Deprecating methods that will be removed soon
Two methods that are dropped in v6.0 are now marked as deprecated in this commit.

As discussed in the removal PR https://github.com/hibernate/hibernate-orm/pull/3229
2020-02-21 06:11:37 -06:00
The Geeky Asian e808041477 HHH-13856 - Long-awaited TODOs done as an improvement
1. TODO: Remove duplicate method from ConstraintConstaint.java currently has two duplicate methods. 1. getColumnIterator()2. columnIterator()

Both the methods return the same value i.e. column.iterator().

One of them needs to be removed in order to reduce and clean the duplication. 

2. TODO: Change method name for getXmlFiles in BaseCoreFunctionalTestCaseCurrently, in BaseCoreFunctionalTestCase a method named getXmlFiles()has a TODO placed that suggests the method name to be changed to getOrmXmlFiles().

Since the method has a protected scope, there is a possibility it is being used by other clients. Hence, changing the method name in minor versions might break the code for clients.
2020-02-20 10:54:50 -06:00
Fabio Massimo Ercoli ccc3c58367 HH-13720 Test mapping model support for plural attributes - sorted map 2020-02-19 06:52:38 -06:00
Andrea Boriero 08b08c0d81 Re-enabled few more tests 2020-02-17 11:24:01 -06:00
gavinking 4f5b37c9c4 Use SequenceSupport everywhere instead of deprecated methods of Dialect 2020-01-30 14:01:34 -06:00
gavinking 9565d499af Big merge of my branch with new Hibernate 6 codebase
Lots of new functionality here related to HQL functions, SQL
dialects, and date/time handling.
2020-01-30 14:01:33 -06:00
Steve Ebersole eab6107ec2 HHH-13785 : HQL/Criteria function support
- temporal literals
- generalized literals
- literal formatters (SQL string generation)
- FORMAT function
2020-01-06 08:38:08 -06:00
Steve Ebersole a39fa09650 HHH-13785 : HQL/Criteria function support
- tests
- Dialect changes
2019-12-21 19:38:22 -06:00
Steve Ebersole 0ec232a326 HHH-13778: `@OrderBy` handling using SQL AST
- complete support other than function support which is still overall not implemented
2019-12-16 15:02:19 -06:00
Andrea Boriero 1d4bb08ef7 Merge remote-tracking branch 'upstream/master' into wip/6.0_merge_16 2019-12-16 12:43:47 +00:00
Steve Ebersole 284b2c5677 HHH-13778: `@OrderBy` handling using SQL AST
- parsing in PluralAttributeMapping implemented
- still need to convert the OrderByFragment to SQL AST and add to the SQL AST order-by-clause
2019-12-12 13:34:37 -06:00
Davide D'Alto dd79fda20d HHH-13704 Remove unused javassist import 2019-12-12 10:33:32 +00:00
Nathan Xu 3a69b74894 HHH-13456 refactor ForeignGenerator to allow for the possibility of StatelessSession 2019-12-11 17:37:31 -06:00
Andrea Boriero 1363844ca0 Implement support for @Embeddable with ToMany and ToOne 2019-12-10 10:00:10 +00:00
Andrea Boriero 79c83cf8ba Merge remote-tracking branch 'upstream/master' into wip/6.0 2019-12-09 12:07:23 +00:00
Nathan Xu ab9ae43185 HHH-8901 replace "in ()" SQL with "in (null)" in QueryParameterBindingsImpl 2019-12-04 16:05:10 +00:00
Andrea Boriero d2865a54df Merge remote-tracking branch 'upstream5/master' into wip/6.0_merge_15 2019-12-02 09:14:27 +00:00
Steve Ebersole 75d436ab25 HHH-13720: Implement mapping model support for plural attributes - sorted set;
HHH-13715: HQL/Criteria DELETE support - support for cleaning-up collection tables
2019-11-27 12:06:21 -06:00
Steve Ebersole 7b489b180c HH-13720: Implement mapping model support for plural attributes - sorted set 2019-11-27 07:23:28 -06:00
Steve Ebersole afb9f9770d HHH-13746: Implement Load by Multiple Ids using SQL AST
composite id testing
2019-11-26 15:12:54 -06:00
Steve Ebersole 0c6c8b4406 more work on multi-id entity loading and key-based loading in general 2019-11-25 15:58:50 -06:00
Jan-Willem Gmelig Meyling 21e79125e6 HHH-9301 - Support select variable refs in group by for DBMS dialects that support it
While not strictly compliant with the SQL specification, the MySQL, PostgreSQL and H2 support the use of select aliases in the GROUP BY clause. An obvious benefit is that produced SQL queries will be easier to read, because complex select expressions from aggregrate queries will have to be included in the group by clause as well. These can now simply reference the aliases of the respective columns for the tuple element. However, there is also a functional difference. For function invocations that have parameterized arguments, the query optimizer can't guarantee the that the function result between the selection projection and grouping process are equal. This results in an error because a value is projected which is not grouped by. An example where this for example becomes relevant, is when parameterizing TimeScaleDB's [`time_bucket_gapfill()`](https://docs.timescale.com/latest/api#time_bucket_gapfill-examples) function.

For example, using `time_bucket_gapfill()` one might want to produce a criteria query that produces the following SQL:

```sql
SELECT
    time_bucket_gapfill(?, time, ?, ?) AS ts,
    avg(tg) as tg
FROM iaqmeasurement
GROUP BY ts
ORDER BY ts;
```

When the alias is not used as grouping value, the query will yield an error:

```sql
SELECT
    time_bucket_gapfill(?, time, ?, ?) AS ts,
    avg(tg) as tg
FROM iaqmeasurement
GROUP BY time_bucket_gapfill(?, time, ?, ?)
ORDER BY ts;
```

Of course the parameter values can just be stored in a CTE as well, but I think we should consider support for variable refs in group by for DBMS dialects that support it. This pull request implements the feature equivalently to how its currently done for order by clauses, and only enables the feature for known supported dialects (H2, PostgreSQL and MySQL - based on [https://stackoverflow.com/a/3841804/2104280](https://stackoverflow.com/a/3841804/2104280)).

Jira: https://hibernate.atlassian.net/browse/HHH-9301

Co-authored-by: Sayra Ranjha <S.S.Ranjha@student.tudelft.nl>
2019-11-25 14:57:17 +00:00
Steve Ebersole 0ec5af2985 HHH-13746 - Implement load-by-multiple-ids using SQL AST 2019-11-23 13:39:48 -06:00
Andrea Boriero f1bf079122 Merge remote-tracking branch 'upstream5/master' into wip/6.0_merge_14 2019-11-22 09:05:57 +00:00
Andrea Boriero 9a0ad0f21d work on aggregate composite identifier 2019-11-21 17:43:25 -06:00
Steve Ebersole 7576b51407 pull over "legacy 6.0" tests 2019-11-21 14:48:38 -06:00
Andrea Boriero 343dd979ba HHH-13725 ToMany FkDescriptor creation and circular fetch detecion 2019-11-20 10:38:24 -06:00
Andrea Boriero 97f9d4ce00 HHH-13725 Work on circular fetc detection 2019-11-20 10:38:24 -06:00
Andrea Boriero ed49f6abcf HHH-13725 - Implement ManyToOne with Join Table associations support 2019-11-15 12:13:40 -06:00
Sanne Grinovero 164e1fc7cc HHH-13687 TenantSchemaResolver not called in integration test after upgrade from 2019-11-12 17:40:59 +00:00