4872 Commits

Author SHA1 Message Date
Andrea Boriero
755f4ef6b6 HHH-14616 Add test for issue
(cherry picked from commit 2a571aeb40a2a5b4fda4adf4bdb6c96a0e92af68)
2021-06-04 11:17:02 -07:00
Yoann Rodière
86d883e998 HHH-13682 Enable extended bytecode enhancement in NaturalIdInUninitializedAssociationTest
This test accesses a field of an entity directly and expects it to be
automatically initialized; this cannot work without extended bytecode
enhancement.

This used to work with Java 8 bytecode, but only by chance. It seems
that Java 8 bytecode relies on "synthetic", static access methods
inserted by the compiler to access the fields of entities in this test:
any access to the field is done through this access method instead of
through a direct field access. Since we apply bytecode enhancement to
all methods of entities, this means that access to fields triggers
initialization, without any bytecode enhancement in the caller class.

I believe this is specific to nested classes, but couldn't find a
source. For reference, the bytecode of access methods looks like this:

  static int access$002(org.hibernate.test.bytecode.enhancement.lazy.NaturalIdInUninitializedAssociationTest$AnEntity, int);
    Code:
       0: aload_0
       1: iload_1
       2: dup_x1
       3: putfield      #3                  // Field id:I
       6: ireturn

  static org.hibernate.test.bytecode.enhancement.lazy.NaturalIdInUninitializedAssociationTest$EntityImmutableNaturalId access$102(org.hibernate.test.bytecode.enhancement.lazy.NaturalIdInUninitializedAssociationTest$AnEntity, org.hibernate.test.bytecode.enhancement.lazy.NaturalIdInUninitializedAssociationTest$EntityImmutableNaturalId);
    Code:
       0: aload_0
       1: aload_1
       2: dup_x1
       3: putfield      #2                  // Field entityImmutableNaturalId:Lorg/hibernate/test/bytecode/enhancement/lazy/NaturalIdInUninitializedAssociationTest$EntityImmutableNaturalId;
       6: areturn

With Java 11, however, access to fields of entities is done directly,
even for nested classes. So the access methods no longer exist, and we
don't get automatic initialization upon field access. We need extended
bytecode enhancement, like we would in any other case of field access
(in particular accessing fields of non-nested classes).

(cherry picked from commit 1060baf74b3d480d026a3d88e9c4b2d4aae118a3)
2021-06-04 10:23:46 -07:00
Yoann Rodière
b95f589e08 HHH-14640 Remove some JTA-related dependencies that weren't there in 5.3.20.Final 2021-06-03 16:10:37 -07:00
Andrea Boriero
b3ae29406a HHH-14640 : Fix checkstyle errors 2021-06-03 16:10:37 -07:00
Andrea Boriero
cc6fe84f30 HHH-14640 : Fix gradle errors 2021-06-03 16:10:37 -07:00
Andrea Boriero
40d82d6370 HHH-14640 : Fix issue with generated pom missing project description 2021-06-03 16:10:37 -07:00
Yoann Rodière
f795213e5a HHH-13689 Replace uses of the deprecated osgi plugin with the biz.aQute.bnd plugin
https://docs.gradle.org/5.0-milestone-1/release-notes.html#deprecated-osgi-plugin
2021-06-03 16:10:37 -07:00
Yoann Rodière
861b3c00aa HHH-13685 Replace uses of deprecated classifier property in Jar tasks with archiveClassifier 2021-06-03 16:10:37 -07:00
Gail Badner
d7b68ba8ce HHH-14537 : Updated test as requested; added tests that lazy associations with non-existing entity is unaffected.
(cherry picked from commit ad84aaf0bcb161b272731c82742018ad3445742b)
2021-04-20 10:57:51 -07:00
Gail Badner
c2bb67515f HHH-14537 EntityNotFoundException thrown when non-existing association with @NotFound(IGNORE) mapped has proxy in PersistenceContext
(cherry picked from commit 3c1e16e06ce7232fbe69bf1a3322d3f251a8bfbb)
2021-04-20 10:57:51 -07:00
Gail Badner
edcf4a6369 HHH-14537 : Added test for issue
(cherry picked from commit 9cb9137fb8a7189a8041c714ade0214ebaf6a0b8)
2021-04-20 10:57:51 -07:00
Steve Ebersole
bc8e38a9a8 HHH-14325 - Add Query hint for specifying "query spaces" for native queries
(cherry picked from commit be70d49df9c1ad5e72507cc9ed770bab689f4a50)
2020-11-16 10:46:35 -06:00
Steve Ebersole
d5067eccf3 HHH-14325 - Add Query hint for specifying "query spaces" for native queries 2020-11-16 10:46:20 -06:00
Andrea Boriero
2896372dd5 HHH-14257 Add test for issue 2020-11-16 09:39:00 +00:00
Andrea Boriero
00b3ccb8ec HHH-14257 An Entity A with a map collection having as index an Embeddable with a an association to the Entity A fails with a NPE 2020-11-16 09:38:56 +00:00
Andrea Boriero
d22bbb5c33 HHH-14225 CVE-2020-25638 Potential for SQL injection on use_sql_comments logging enabled 2020-11-13 13:34:09 +00:00
Andrea Boriero
096916e6fa HHH-13310 getParameterValue() not working for collections 2020-11-10 18:53:09 +00:00
Andrea Boriero
36f9360a31 HHH-13310 Add test for issue 2020-11-10 18:52:59 +00:00
Scott Marlow
06fdd27b3d HHH-14196 Add parsing of persistence.xml/orm.xml documents in the EE 9 namespace
Signed-off-by: Scott Marlow <smarlow@redhat.com>
2020-11-10 13:23:57 +00:00
Steve Ebersole
204dc9f9db Fixed Javadoc for BulkOperationCleanupAction.affectedEntity 2020-11-10 11:35:03 +00:00
Andrea Boriero
1cdf75c212 HHH-14077 PostgreSQL, skip testLiteralProjectionAndGroupBy (PostgreSQL does not support literals in group by statement) 2020-08-04 14:58:21 -07:00
Gail Badner
646b383f95 HHH-14077 : CVE-2019-14900 SQL injection issue in Hibernate ORM 2020-08-04 14:58:21 -07:00
Gail Badner
d7400b5a08 HHH-14103 : Add test cases showing that an entity's transient attribute can be overridden to be persistent in entity subclasses
(cherry picked from commit fb40f8edc04edf9e47b7d95aa3b0a77d03dda57d)
2020-08-04 14:47:41 -07:00
Vlad Mihalcea
7317331108 HHH-13110 - @PreUpdate method on a Embeddable null on the parent caused NullPointerException
(cherry picked from commit 3ff3615d00f1e4471380fb1ab7f3da5f297fc8b9)
2020-08-03 15:15:36 -07:00
Gail Badner
23fae34ea9 Revert "HHH-14096 Remove unused import for deprecated type XmlDocument and dom4j"
Imports are required for 5.3 branch

This reverts commit 5ead0e4dd5fb0ca1a2902718de660718b88ffa8f.
2020-08-03 15:12:51 -07:00
Sanne Grinovero
eeb8225b6f HHH-14096 Moving the XMLHelper from ORM core into testsuite helpers
(cherry picked from commit 115b5b99761e0766dd7b514abdf750665510fc82)
2020-08-03 15:12:51 -07:00
Sanne Grinovero
b13291591f HHH-14096 Remove unused import for deprecated type XmlDocument and dom4j
(cherry picked from commit 77ee4529a6d75d06f489109b91d241822ed53b93)
2020-08-03 15:12:51 -07:00
Gail Badner
bc0f109540 HHH-12268 : LazyInitializationException thrown from lazy collection when batch fetching enabled and owning entity refreshed with lock
HHH-12268 : Add imports back in because they are required for 5.3
2020-08-03 15:03:39 -07:00
Gail Badner
d7af5ffbd6 HHH-12268 : Added test case 2020-08-03 15:03:39 -07:00
Andrea Boriero
b425c6045f HHH-13936 Add additional test
(cherry picked from commit 0e1713a3a0a53aa220fd9715069f1401fd8ba327)
2020-05-19 09:23:33 +01:00
michiel.hendriks
7b7ef154d1 HHH-13936 Call pulseTransactionCoordinator before checking for transaction in flush()
(cherry picked from commit 585ca8e2bf772543476e2d89a76782ed8aa21ea6)
2020-05-19 09:23:33 +01:00
Sanne Grinovero
f35229d19a HHH-13695 DDL export forgets to close a Statement
(cherry picked from commit b4a8052a152c34ee1607cb96799087ffb9b09bd8)
2020-04-29 16:39:11 -07:00
Panagiotis Sotiropoulos
78bcb66cd5 HHH-13960 Add SAXReader sec features to match the defaults 2020-04-21 10:50:46 +01:00
Gail Badner
2574016f44 HHH-13910 : MySQL57Dialect selected by automatic dialect resolution when using MySQL 8.0 database
(cherry picked from commit e1d2aecef75bef9e61c64964fbb2e0103dafff7d)
2020-03-26 21:26:41 -07:00
Gail Badner
5d51d48cea HHH-13910 : Added and corrected tests
(cherry picked from commit caded6cd40877e082bcd93e8a20ce70a969efe90)
2020-03-26 21:26:41 -07:00
Yanming Zhou
a7120626ab HHH-12977 - Update latest dialect for MySQL
(cherry picked from commit a9fd8efe3363ddd141b8add965a5f725ab9ff05c)
2020-03-26 21:26:41 -07:00
Gail Badner
3005b4bc60 HHH-13891 : ProxyFactory should not be built if any ID or property getter/setter methods are final
(cherry picked from commit a54d657d98795e88b5541b9aa05a4621c9f5f1b5)
2020-03-25 19:52:42 -07:00
Gail Badner
c1f79fd304 HHH-13891 : Added test
(cherry picked from commit 3427bc8414b90910fe79b93a812e72bcc2f72398)
2020-03-25 19:52:42 -07:00
Sanne Grinovero
e0be465f2c HHH-13851 Remove a dead code field from PojoEntityTuplizer
(cherry picked from commit 8043e49384eb3fc454457d8657b823ab290c4315)
2020-03-25 19:52:42 -07:00
Sanne Grinovero
8d73884cbf HHH-13851 Rework initialization of ProxyFactoryFactory, allow some code reuse from SPI
(cherry picked from commit 0964b881f726d3a2bb1a207cf7105b4bc62027a8)
2020-03-25 19:52:42 -07:00
Joël Arnold
9fc4f5b8e7 HHH-13184 - Oracle dialect detection does not return latest dialect in the default case 2020-03-25 19:47:53 -07:00
Andrea Boriero
f0ffae0198 HHH-12858 HHH-13432 fix Oracle failing tests
(cherry picked from commit 1c840f9dd17c75f1e01667fe26b71753f97c7168)
2020-01-07 14:06:41 -08:00
Steve Ebersole
814a5ce6e2 HHH-12858 - integration overrides during JPA bootstrap ought to override all logically related settings
HHH-13432 - Have EntityManagerFactory expose persistence.xml `jta-data-source` element as a `javax.persistence.nonJtaDataSource` property

(cherry picked from commit ab508d2afacd3aa564d2a71ad067b2e11adebba7)
2020-01-07 14:06:41 -08:00
Steve Ebersole
cec3107e13 HHH-12858 - integration overrides during JPA bootstrap ought to override all logically related settings
HHH-13432 - Have EntityManagerFactory expose persistence.xml `jta-data-source` element as a `javax.persistence.nonJtaDataSource` property

(cherry picked from commit fd72e4f75f73703511b9b47fbcc15a0438a69c2d)
2020-01-07 14:06:41 -08:00
Steve Ebersole
7eb0911fd6 HHH-12858 + HHH-13432 Persistence.createEntityManagerFactory(Map) should allow overwriting jta-data-source of persistence.xml
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
2020-01-07 14:06:41 -08:00
Yosef Yona
3e1663a66e HHH-13651 Applying hibernate codestyle to PersistentBag
(cherry picked from commit a5c8a812f5bd7bd80ab821e24be55b95d0ea8c04)
2020-01-07 13:40:36 -08:00
Yosef Yona
bdf0a89f82 HHH-13651 NPE on flushing when ElementCollection field contains null element
(cherry picked from commit 2808a75d5cefcf7703eb9d3448f25ae998343d22)
2020-01-07 13:40:36 -08:00
Christoph Dreis
0115b89fe1 HHH-13675 : Optimize PersistentBag.groupByEqualityHash()
(cherry picked from commit 3b1e7afb20ce934abe35150889f02b41be98ca0c)
2020-01-07 13:40:36 -08:00
Sanne Grinovero
e641afa674 HHH-13651 Adding a regression test for the issue
(cherry picked from commit e5539cc36c6173bb9fdc404c658cc5f280967467)
2020-01-07 13:40:36 -08:00
Gail Badner
39a0c2f714 HHH-13737 : Correct log message and fix checkstyle failure 2020-01-07 12:04:44 -08:00