CAMEL-24604: camel-jpa - Mark KeyValueEntry.isExpired() as @Transient - #26068
CAMEL-24604: camel-jpa - Mark KeyValueEntry.isExpired() as @Transient#26068JiriOndrusek wants to merge 1 commit into
Conversation
The entity uses property access, so the derived isExpired() getter was
treated as a persistent property without a setter and Hibernate failed to
build the SessionFactory ("Could not locate setter method for property
'expired'"). On Quarkus this broke any application with camel-jpa on the
classpath, since the entity is auto-discovered and mapped with Hibernate.
The fix is covered by the new KeyValueEntryHibernateMappingTest, which runs
in every bu.
The OpenJPA enhancer -javaagent is now configured only while the openjpa
profile is active: the agent jar is copied to target/ by that profile alone,
so with -Dhibernate the forked test JVM pointed at a missing jar and failed
to start. The OpenJPA persistence.xml configuresopenjpa provcider
(as hibernate is now on classpath)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 9 tested, 27 compile-only — current: 9 all testedMaveniverse Scalpel detected 36 affected modules (current approach: 9).
|
|
Thanks for the fix, it is correct as is. A few suggestions before merging: 1. Consider field access instead of 2. Map 3. 4. The javaagent comment states the wrong cause ( Claude Code on behalf of Croway |
Fixes CAMEL-24604
Follow-up ticket: https://issues.apache.org/jira/browse/CAMEL-24615
KeyValueEntryuses property access, so the derivedisExpired()getter was treated as a persistent property without a setter and Hibernate failed to build the SessionFactory (Could not locate setter method for property 'expired'). On Quarkus, where every classpath@Entityis auto-discovered and mapped with Hibernate, this broke any application having camel-jpa on the classpath.@Transientexcludes the helper from the persistent metamodel — no schema or behavior change.The fix is covered by the new
KeyValueEntryHibernateMappingTest, which verifies the Hibernate mapping in every build (native Hibernate bootstrap, so the rest of the suite keeps using OpenJPA; the default persistence units are pinned to the OpenJPA provider to keep resolution deterministic with two providers on the classpath)🤖 Generated with Claude Code
Description
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.AI-assisted contributions
Co-authored-bytrailers) and the PR description identifies the AI tool used.