Commit Graph

308 Commits

Author SHA1 Message Date
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
Steve Ebersole dd0b6a9da3 Revert "HHH-13656 Con not build and run test on Eclipse IDE"
This reverts commit f6fad942df.
2019-11-08 07:07:56 -06:00
Steve Ebersole 7e34be04db Revert "HHH-13656 Can not build and run test on Eclipse IDE"
This reverts commit 0f859e7bb4.
2019-11-08 06:50:59 -06:00
hailtondecastro 0f859e7bb4 HHH-13656 Can not build and run test on Eclipse IDE
Eclipse windows
2019-11-01 11:23:36 -05:00
hailtondecastro f6fad942df HHH-13656 Con not build and run test on Eclipse IDE
Eclipse windows
2019-11-01 11:23:36 -05:00
Steve Ebersole f5c3ae181c initial discriminator hierarchy support 2019-10-22 14:45:14 -05:00
Andrea Boriero 567eb38069 Merge remote-tracking branch 'upstream5/master' into wip/6.0_merged_6 2019-10-09 18:00:48 +01:00
Steve Ebersole b350599442 HHH-12858 - integration overrides during JPA bootstrap ought to override all logically related settings
- e.g. a datasource passed in the integration overrides map ought to effectively override JDBC-connection settings in `persistence.xml` (and vice-versa)

HHH-13432 - Have EntityManagerFactory expose persistence.xml `jta-data-source` element as a `javax.persistence.nonJtaDataSource` property
2019-10-03 16:03:43 +01:00
Andrea Boriero 726dbeef34 Merge remote-tracking branch 'upstream5/master' into wip/6.0_merged_4 2019-09-30 16:45:27 +01:00
Steve Ebersole b9f4562680 fixed source of NPE wrt accessing an entity's version attribute descriptor when no versioning is defined;
added `@org.hibernate.testing.orm.junit.SessionFactory#exportSchema`
2019-09-26 14:14:19 -05:00
Steve Ebersole 57fba402b4 HHH-12858 - Persistence.createEntityManagerFactory(Map) should allow overwriting jta-data-source of persistence.xml 2019-09-25 15:12:25 -05:00
Steve Ebersole 5631a702a7 initial working dynamic instantiation support;
cleanup
2019-09-19 15:13:50 -05:00
Steve Ebersole 648dd3d2ed More work on EntityResult handling;
Changes to how SqmParameters are handled to account for criteria parameters
2019-09-16 08:51:16 +01:00
Steve Ebersole 76b42a94c3 Initial working support for selecting a "query root" - i.e. `select e from TheEntity e` 2019-09-12 10:42:33 +01:00
Andrea Boriero f85fe137b2 Initial working support for building and executing JdbcSelect operation from simple HQL 2019-09-12 10:42:33 +01:00
Steve Ebersole dbd108e0b7 Initial working support for building and executing JdbcSelect operation from simple HQL 2019-09-12 10:42:33 +01:00
Steve Ebersole 0acd11fae3 6 - SQM based on JPA type system
Completed rebase on master (from the point just after HHH-11147 work) - fixed compilation failures
2019-09-12 10:42:33 +01:00
Steve Ebersole 5aea8bcf6a 6 - SQM based on JPA type system
Completed rebase on master (from the point just after HHH-11147 work) - fixed compilation failures
2019-09-12 10:42:33 +01:00
Steve Ebersole b101ffbf79 6 - SQM based on JPA type system
- moving SQM-specific tests from wip/6.0
2019-09-12 10:42:32 +01:00
Andrea Boriero 588f11684d 6 - SQM based on JPA type system 2019-09-12 10:42:31 +01:00
Andrea Boriero 911c0220fe 6 - SQM based on JPA type system 2019-09-12 10:42:31 +01:00
Steve Ebersole 8d0ff71dfc 6 - SQM based on JPA type system
- further work on `org.hibernate.query` (especially `NamedQueryRepository` and friends)
- initial work on `org.hibernate.sql.exec`
- initial work on `org.hibernate.sql.results`
- SemanticPathPart handling
- NamedQueryMemento
- work on ProcedureCall
- continued work on `org.hibernate.sql.exec`
- continued work on `org.hibernate.sql.results`
- ported `hibernate-testing` JUnit 5 support
2019-09-12 10:42:29 +01:00
Sanne Grinovero 4661efa468 HHH-13591 Fixing formatting of previous patch 2019-08-20 08:44:51 +01:00
Carsten Hammer 19ac013eeb HHH-13591 Replaces simple uses of array iteration with a corresponding for-each loop 2019-08-20 08:44:39 +01:00
Andrea Boriero 210aff098c HHH-13577 LockTest.testContendedPessimisticLock and StatementIsClosedAfterALockExceptionTest.testStatementIsClosed tests fail on Sybase
HHH-13577 : Re-enable LockTest for SybaseASE15Dialect
2019-08-14 18:43:09 -07:00