Consider the model :
{code:java}@Entity public static class Spouse { ... private String last;
@Id Integer getId() {...}; String getLastName() {...}; void setLastName(String name) {...}; }{code}
Here, we have PROPERTY access (getter and setter) because of the placement of {{@Id}}. Which in turn means that we have a persistent attribute named {{lastName}}based on the getter method name.
This confuses the enhancer which always works from the field name. Here, it thinks the persistent attribute is named {{last}}.
----
Jakarta EE 10 TCK test jpa/core/query/flushmode ( #flushModeTest5 ) [https://github.com/jakartaee/platform-tck/blob/master/src/com/sun/ts/tests/jpa/core/query/flushmode/Client.java#L355|https://github.com/jakartaee/platform-tck/blob/master/src/com/sun/ts/tests/jpa/core/query/flushmode/Client.java#L355|smart-link] fails.
The tests that fail with vehicle names:
* flushModeTest5_from_appmanagedNoTx * flushModeTest5_from_pmservlet * flushModeTest5_from_puservlet * flushModeTest5_from_stateless3
The same tests pass with bytecode enhancement disabled.
The test output contains:
[javatest.batch] ^[[0m^[[0m12:24:15,206 INFO [stdout] (Thread-197) 05-02-2023 12:24:15: SVR-ERROR: Wrong collection size returned (expected 1, got 0) [javatest.batch] ^[[0m^[[0m12:24:15,207 INFO [stdout] (Thread-197) 05-02-2023 12:24:15: SVR-ERROR: Wrong size returned, expected PKs of (11), got PKs of () [javatest.batch] ^[[0m^[[0m12:24:15,207 INFO [stdout] (Thread-197) 05-02-2023 12:24:15: SVR-ERROR: Did not get expected results. Expected 1 reference, got: 0 [javatest.batch] ^[[0m^[[0m12:24:15,207 INFO [stdout] (Thread-197) 05-02-2023 12:24:15: SVR-ERROR: flushModeTest5 failed [javatest.batch] ^[[0m^[[0m12:24:15,207 INFO [stdout] (Thread-197) 05-02-2023 12:24:15: SVR-ERROR: Test case throws exception: flushModeTest5 failed [javatest.batch] ^[[0m^[[0m12:24:15,207 INFO [stdout] (Thread-197) 05-02-2023 12:24:15: SVR-ERROR: Exception at: [javatest.batch] ^[[0m^[[0m12:24:15,208 INFO [stdout] (Thread-197) 05-02-2023 12:24:15: SVR-ERROR: com.sun.ts.lib.harness.EETest$Fault: flushModeTest5 failed [javatest.batch] ^[[0m^[[0m12:24:15,209 INFO [stdout] (Thread-197) at deployment.jpa_core_query_flushmode_vehicles.ear.jpa_core_query_flushmode_appmanagedNoTx_vehicle_ejb.jar// |
|