Jiří Ondrušek created CAMEL-24604:
-------------------------------------
Summary: camel-jpa - KeyValueEntry cannot be mapped by Hibernate:
isExpired() lacks @Transient
Key: CAMEL-24604
URL: https://issues.apache.org/jira/browse/CAMEL-24604
Project: Camel
Issue Type: Bug
Components: camel-jpa
Affects Versions: 4.23.0
Reporter: Jiří Ondrušek
Assignee: Jiří Ondrušek
KeyValueEntry (added by CAMEL-24463) uses property access, so the derived
{{isExpired()}} getter is treated as a persistent property without a setter.
Hibernate fails to build the SessionFactory:
{noformat}
org.hibernate.PropertyNotFoundException: Could not locate setter method for
property 'expired'
of class 'org.apache.camel.processor.keyvalue.jpa.KeyValueEntry'
{noformat}
Unnoticed because camel-jpa tests default to OpenJPA (lenient) and the
hibernate profile never mapped the entity. On Quarkus every classpath @Entity
is auto-discovered, so any application with camel-jpa + hibernate-orm fails to
start (found via the Camel Quarkus nightly examples).
Reproducer: https://github.com/JiriOndrusek/camel/tree/jpa-hibernate-reproducer
{noformat}
cd components/camel-jpa
mvn clean test -Dtest=JpaKeyValueRepositoryTest -Dhibernate
{noformat}
All 23 tests fail with the exception above. Suggested fix: {{@Transient}} on
{{isExpired()}} - with it the same 23 tests pass under both the hibernate and
the default OpenJPA profile.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)