Commit Graph

5569 Commits

Author SHA1 Message Date
Christian Beikov a32afda0ec HHH-14148 Fix ANTLR grammar non-determinism 2020-09-29 11:35:59 +01:00
Nathan Xu 4e99460460 HHH-14148 fix issue mapping order SQL fragment could produce incorrect SQL 2020-09-29 11:35:59 +01:00
Nathan Xu b33972b44e HHH-14201 fix HQL JOIN order issue 2020-09-29 11:35:59 +01:00
Yanming Zhou a9887cb7d2 HHH-14219 Fix duplicated rows of sequence table
if generator is shared by multiple entities
2020-09-29 11:35:59 +01:00
Andrea Boriero 21e2c5b2f1 HHH-14220 Skip test when bytecode provider is Javassist 2020-09-29 11:35:59 +01:00
Andrea Boriero ebe9756909 HHH-14220 Add test for issue 2020-09-29 11:35:59 +01:00
Sanne Grinovero d16799c2a4 HHH-14236 Improve efficiency of ForeignKeyKey 2020-09-28 16:10:58 +01:00
Andrea Boriero cddb67f103 HHH-14220 EnhancementException failure with MappedSuperclass with a un-mapped collection 2020-09-28 16:10:52 +01:00
Yanming Zhou a047e9a136 HHH-14230 Fix generics to avoid ClassCastException 2020-09-28 12:45:04 +01:00
Gavin King bc25867826 HHH-14204 Schema validator should be more forgiving of column type mismatches 2020-09-09 18:02:07 +01:00
Falko Modler 15673f5d2e 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 11:28:55 +01:00
Gavin King 55b46f1855 HHH-14153 refactoring after HHH-14153
- avoid use package-scoped instance felds
- remove copy/pasted code

Note: I don't hate package-scoped final fields, but I
know other folks tend to. So let's go with template
methods instead.
2020-08-27 09:56:54 +01:00
Gavin King a49795549a HHH-14153 Make buildAppropriateStatementExecutor() protected
Hibernate Reactive might ultimately need to override
this method, though it doesn't right now.

Relates to HHH-14153.
2020-08-27 09:56:48 +01:00
Gavin King 6e9b488ec1 HHH-14153 add test
By NathanQingyangXu

See https://github.com/hibernate/hibernate-orm/pull/3508
2020-08-27 09:56:40 +01:00
Gavin King 9dd2d94afb HHH-14153 further optimization for single-table HQL update
This extends the optimization for single-table HQL bulk
updates to the case where the where clause touches multiple
tables and we can use a subselect to collect the ids that
we need to update.
2020-08-27 09:56:22 +01:00
Gavin King f182b3b366 HHH-14153 clean up BasicExecutor and friends
introduces InsertExecutor and UpdateExecutor since we're
going to be introducing specific optimizations relating
to single-table updates

relates to HHH-14153
2020-08-27 09:56:15 +01:00
Gavin King 564c05a65a HHH-14153 optimize away temp table for single-table HQL update
When a HQL bulk update query only touches a single table,
use BasicExecutor instead of MultiTableUpdateExecutor.

This is an alternate implementation to the one proposed by
@NathanQingyangXu in #3508 and loosely based on that work.
2020-08-27 09:56:05 +01:00
Sanne Grinovero b1dea1b17a HHH-14193 MultipleLinesSqlCommandExtractor should tolerate empty input scripts 2020-08-26 22:19:44 +01:00
Steve Ebersole b4afea78b5 HHH-14152 sql-script.g fix for antlr non deterministic warning
- Added "system"-style SqlScriptLogging
- Added rule trace logging through SqlScriptLogging
2020-08-26 15:08:26 +01:00
Andrea Boriero 8beb1a2c65 HHH-14152 sql-script.g fix for antlr non deterministic warning 2020-08-26 15:08:17 +01:00
Sanne Grinovero b7c871db41 HHH-14190 Method StringHelper#moveAndToBeginning could benefit from using the improved helper too 2020-08-26 13:20:52 +01:00
Sanne Grinovero 4fe81f22ec HHH-14190 Improve efficiency of StringHelper#isBlank 2020-08-26 13:20:46 +01:00
Gavin King c6728684bb HHH-14190 Rename isEmptyOrWhitespace() to isBlank()
and use it in more places
2020-08-26 13:20:40 +01:00
Andrea Boriero 3b32bb9ecd HHH-14187 Add test for issue 2020-08-26 11:25:23 +01:00
Andrea Boriero 8650e2734c HHH-14187 Lazy loading fails if an entity appears twice in the object graph when enhancement as proxy is enabled 2020-08-26 11:25:23 +01:00
Gavin King c7792af01c HHH-14181 Fix bug where HQL update/delete query resulted in same table being updated twice
for HQL bulk update/delete against union-subclass mapping

also clean up iterator usage in that section of code
2020-08-24 21:39:43 +01:00
Falko Modler 2f64fb1db2 HHH-14179 fix MultiLineImportExtractorTest on Windows 2020-08-24 20:25:45 +01:00
Gavin King b48d9668b7 HHH-14183 LocalTimeJavaDescriptor attempts casting to LocalDate 2020-08-24 19:29:53 +01:00
Nathan Xu 4b97be39db HHH-14154 Incorrect SQL generated from Criteria API when concat() and function() methods are used together 2020-08-21 11:34:27 +01:00
Nathan Xu 4716262645 HHH-14152 Preserve end-of-line chars in MultiLineImportExtractor 2020-08-21 11:33:55 +01:00
Nathan Xu 6243dca71a HHH-14156 IN subquery predicate with entity aliases produces wrong SQL "too few columns in subquery" 2020-08-21 11:22:56 +01:00
Nathan Xu aa8d4361f5 HHH-3326 fix temp table collation issue for SQLServer dialect 2020-08-21 11:22:47 +01:00
Jezza 1cdb205ac3 HHH-14175 StatefulPersistenceContext#getLoadedCollectionOwnerOrNull could NPE on missing CollectionEntry
Avoids NPE, as the collection entry could not exist.
2020-08-21 10:57:27 +01:00
Gavin King 354fc08a5e expose some private fields via getters for Hibernate Reactive
needed for https://github.com/hibernate/hibernate-reactive/issues/237
2020-08-20 15:40:34 +01:00
Guillaume Smet 0e5cb4d705 HHH-14160 Use a runtime used class for testing Bean Validation presence 2020-08-20 15:28:14 +01:00
Sanne Grinovero 9ea3a936fb HHH-14149 Improve efficiency of LazyAttributesMetadata#getLazyAttributeNames 2020-08-12 11:31:35 +02:00
Jay Paulsen 194293330b HHH-13380 Test for the issue 2020-08-12 10:09:49 +02:00
Sanne Grinovero c1f9b9dda4 HHH-13380 Bytecode enhanced entities might throw LazyInitializationException from custom equals/hashcode implementations
Apparently we trigger the need to invoke equals/hashcode methods on managed entities just before the Session is attached to the BytecodeLazyAttributeInterceptor
2020-08-12 10:09:49 +02:00
Andrea Boriero 5d38bf5eea HHH-14126 Add CockroachDB to DefaultDialectSelector and update documentation to mention the new dialect 2020-08-10 15:18:44 +02:00
Oliver Breidenbach 80a59af39f HHH-14109 Use 'in expression count limit' if calculated count is greather than 'in expression count limit' 2020-08-10 13:05:15 +02:00
Andrea Boriero 1f09db3c1c HHH-14129 Bidirectional relationship with @NotNull fails to save 2020-08-10 12:09:56 +02:00
Andrea Boriero 2f575f7e04 HHH-14129 Add test for issue 2020-08-10 12:09:47 +02:00
Sanne Grinovero 2587709603 HHH-14143 Detect illegal concurrent usage of LogicalConnectionManagedImpl 2020-08-10 11:54:10 +02:00
Gavin King 96bc705d9a HHH-14142 Make constructor of StatelessSessionImpl public
needed by Hibernate Reactive, see:

https://github.com/hibernate/hibernate-reactive/pull/310
https://hibernate.atlassian.net/browse/HHH-14142
2020-08-09 08:52:58 +02:00
Sanne Grinovero 6392de46d0 HHH-14137 Some more string check performnance optimisations 2020-08-06 17:57:42 +02:00
Ihar Sadounikau ea333d23b6 HHH-14137 Empty String check performance improvements 2020-08-06 17:18:15 +02:00
Sanne Grinovero 60a063bce2 HHH-13974 Test efficiency improvements 2020-08-05 17:06:16 +02:00
Michael Spahn 68edfadc65 HHH-13974 FlushMode set through SessionBuilder was never applied 2020-08-05 17:06:11 +02:00
Steve Ebersole c1254cc205 HHH-14033 SQL script parsing problem with multi-line comments
- Better handling of multi-line comments
- Restructured some internal classes to consolidate packages
- Added "system"-style SchemaToolingLogging
2020-08-05 15:40:10 +02:00
Yoann Rodière 00989d28d8 HHH-14124 Test that the FETCH entitygraph semantic overrides EAGER associations to LAZY for all results 2020-07-30 13:37:28 +01:00
Yoann Rodière b15835788b HHH-14124 Test that the FETCH entitygraph semantic overrides EAGER associations to LAZY 2020-07-30 13:37:22 +01:00
Yoann Rodière 2c98ab236d HHH-14124 Avoid too many list allocations when hydrating query results
I suspect the original goal of having a single list of hydrated objects
for all rows was to avoid instantiating one list per row, but we did
just that in the fix in the last commit.

This introduces a hack to signal that we're starting to process a new
row while still keeping a flat, single-list structure: we inserting
null elements in the list of hydrated objects.

This is admittedly very ugly, but it's the only solution I can come up
with if we want to keep the number of memory allocations similar to what
we used to have. And hopefully this code will disappear in ORM 6.0.
2020-07-30 13:37:11 +01:00
Yoann Rodière 3bdc5af63d HHH-14124 Work around side-effects of TwoPhaseLoad.initializeEntity 2020-07-30 13:36:58 +01:00
Gail Badner b050a7c1bc HHH-14103 : Add test cases showing that an entity's transient attribute can be overridden to be persistent in entity subclasses 2020-07-27 14:21:22 +01:00
Andrea Boriero b57ad86500 HHH-13724 Fix failing tests 2020-07-27 13:52:40 +01:00
Andrea Boriero fc2be527aa HHH-13724 CriteriaLiteralWithSingleQuoteTest#testLiteralProjectionAndGroupBy add @SkipForDialect for CockroachDB Dialect 2020-07-27 13:52:21 +01:00
Rafi Shamim 29224e88bb HHH-13724 Add CockroachDB dialects and configs for testing 2020-07-27 13:52:10 +01:00
Nathan Xu 3765f5d6ca HHH-14116 Exception when fetch joining a non-collection when selecting non-query-root 2020-07-27 13:29:37 +01:00
Gail Badner 148cc15764 HHH-14112 : Invalid Pagination COUNT query generated with @Inheritance(strategy = InheritanceType.JOINED) 2020-07-27 13:19:47 +01:00
Andrea Boriero 16e45bc3d5 HHH-13410 - Fix Oracle failing test 2020-07-27 13:07:03 +01:00
Oliver Saggau d9180963e7 HHH-14071 Add test cases for issue 2020-07-22 10:12:40 +02:00
Oliver Saggau 6027fe1eea HHH-14071 Fix binding for FetchProfile for OneToOne(mappedBy=...) associations 2020-07-22 10:12:35 +02:00
Gittenburg 33e51c0c47 HHH-14041 - H2Dialect: fix referential integrity constraint constraint name extraction 2020-07-21 20:28:00 +02:00
gajendra.jatav 0eca528cc5 HHH-13410 Adding test case 2020-07-21 19:27:22 +02:00
gajendra.jatav 41b57a9cf9 HHH-13410 Option "order_inserts = true" causes FK Violation when inserting with a Unidirectional Relations between 4 Entities 2020-07-21 19:27:14 +02:00
katiforis 88381a58c8 HHH-14093 Make StatefulPersistenceContext#registerInsertedKey and StatefulPersistenceContext#wasInsertedDuringTransaction use HashSet instead of ArrayList 2020-07-21 17:43:03 +02:00
Sanne Grinovero 1ce322bceb HHH-13926 Test for the issue 2020-07-21 15:15:02 +02:00
Sanne Grinovero ccc99c972c HHH-13926 Remove no longer used parameters 2020-07-21 15:14:53 +02:00
Sanne Grinovero 061a85e631 HHH-13926 Propagate the original SQL to the Expectation so it can be logged 2020-07-21 15:14:43 +02:00
Sanne Grinovero 3ea0c5afe6 HHH-13926 Extract JdbcObserver lookup from the batching loop 2020-07-21 15:14:32 +02:00
Gail Badner b4b5a6f379 HHH-12268 : LazyInitializationException thrown from lazy collection when batch fetching enabled and owning entity refreshed with lock
(cherry picked from commit 06c78087ff)
2020-07-17 09:19:01 -07:00
Gail Badner f13cdcf2c9 HHH-12268 : Added test case
(cherry picked from commit f5d710b97d)
2020-07-17 09:19:01 -07:00
Andrea Boriero 6f3d60820c HHH-14108 PADDED and DYNAMIC Batch loading strategies not compatible with the Enhanced Proxy feature 2020-07-16 16:54:21 +01:00
Andrea Boriero 83404586ea HHH-14108 Add test for issue 2020-07-16 16:53:51 +01:00
Jens Borrmann 7698fc1707 HHH-14106 - Return entry from `#parentsByChild` in `StateFulPersistenceContext#getParentsByChild`
(cherry picked from commit 3159c8ff78)
2020-07-15 07:24:19 -05:00
Andrea Boriero ef8e028ded HHH-13214 Delete re-firing SQL from previous calls 2020-07-15 09:52:32 +01:00
Andrea Boriero 3553576236 HHH-13214 Delete re-firing SQL from previous calls 2020-07-15 09:52:25 +01:00
lining 0b71131136 HHH-13214 Delete re-firing SQL from previous calls 2020-07-15 09:52:18 +01:00
Nathan Xu 0614bfe3b8 HHH-14097 fix bug that redundant SQLs might be issued for 'FETCH' entity graph 2020-07-09 14:10:53 +01:00
Sanne Grinovero 115b5b9976 HHH-14096 Moving the XMLHelper from ORM core into testsuite helpers 2020-07-07 09:43:00 +01:00
Sanne Grinovero 77ee4529a6 HHH-14096 Remove unused import for deprecated type XmlDocument and dom4j 2020-07-07 09:42:55 +01:00
Xavier Dury efe151daa9 HHH-13931 MissingFormatArgumentException in JpaCompliantLifecycleStrategy.BeanImpl 2020-07-06 13:37:45 +01:00
yuanhang zheng 27bb8980d0 HHH-14059 Cannot use full qualified enum name which has two uppercase alphabet prefix 2020-07-06 12:54:17 +01:00
Lefteris Katiforis ebdc5681b9 HHH-14021 - Add Java Type byte to JDBC Type TINYINT mapping as described in specification in TABLE B-2. 2020-07-06 11:09:22 +01:00
Falko Modler 8b78ad7685 HHH-14023 H2Dialect: adjust NUMERIC, DECIMAL & VARBINARY for 1.4.201+ 2020-06-22 11:38:16 +01:00
Falko Modler a5b1d4ea07 HHH-14023 H2Dialect: SequenceInformationExtractorLegacyImpl for 1.4.201+ 2020-06-22 11:38:06 +01:00
Andrea Boriero b2ba06e231 HHH-14077 PostgreSQL, skip testLiteralProjectionAndGroupBy (PostgreSQL does not support literals in group by statement) 2020-06-22 10:54:36 +01:00
Gail Badner e0e22ea256 HHH-14077 : CVE-2019-14900 SQL injection issue using JPA Criteria API 2020-06-22 10:54:35 +01:00
Gail Badner b038e24c08 HHH-14077 : Added test case 2020-06-22 10:54:35 +01:00
Gail Badner 99c56527c8 HHH-14075 Changes to loaders and TwoPhaseLoad to allow "internal" loading to be reused by hibernate-reactive 2020-06-22 10:04:16 +01:00
Andrea Boriero 18407c954b HHH-14081 CompositeIdFkGeneratedValueIdentityTest and CompositeIdFkGeneratedValueTest failures on Oracle db 2020-06-19 15:27:45 +01:00
Gail Badner 80a449a1ed HHH-14044 : Extract code from Loader into protected methods 2020-05-29 10:28:16 +01:00
Hannes Rosenögger e8713fd12d HHH-14022 Revert HHH-13322 Fix Oracle dialect's introduced in 5.4.13 that is causing issues with sequence increment determination 2020-05-29 10:14:42 +01:00
Jason Pyeron 340e50ec25 HHH-10956 reduced runtime complexity, added Component.getProperty(int)
Component.getProperty(String) was looping and comparing, but we already now the position of the property
2020-05-29 09:40:08 +01:00
Andrea Boriero 2defb17157 HHH-10956 an exception has to thrown when the composite key is an association and its value is null 2020-05-29 09:40:08 +01:00
Andrea Boriero 38006d2dc7 HHH-10956 Add additional test 2020-05-29 09:40:08 +01:00
Andrea Boriero ed3f59b131 HHH-10956 Moved tests using GenerationType#IDENTITY into another class annotated with @RequiresDialectFeature(DialectChecks.SupportsIdentityColumns.class) 2020-05-29 09:40:08 +01:00
Jason Pyeron 013d528916 HHH-10956 put one line if in {} 2020-05-29 09:40:08 +01:00
Jason Pyeron 8b7903dfc4 HHH-10956 added more complext tests with self referential FK
* known issue: HHH-13971, test marked as @Ignore
* added some output debugging to help developers review CI/CD logs
* 8 tests, 1 ignored, 0.745s duration
2020-05-29 09:40:08 +01:00
Jason Pyeron 87cfe33b5c HHH-10956 fixed failed insertion with IdClass with partial identifier generation
* regression introduced by HHH-4848
* AbstractEntityTuplizer lines 179 and 311 formatting issues, preserved
* bug HHH-9662 blocks testing of Identity insertion
2020-05-29 09:40:08 +01:00