Describe the bug
I have these Java classes:
A MappedSuperclass AbstractEntity that is a superclass for all JPA entities:
@MappedSuperclass
public abstract class AbstractEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
...
}
And these JPA entity classes:
The Order class:
@Entity
@Table(name = "orders")
public class Order extends AbstractEntity {
...
@OneToOne
@JsonIgnore
private Cart cart;
...
}
The Cart class:
@Entity
@Table(name = "carts")
public class Cart extends AbstractEntity {
@ManyToOne
private Customer customer;
...
}
And finally the Customer class:
@Entity
@Table(name = "customers")
public class Customer extends AbstractEntity {
...
}
I have a JpaRepository to find orders using the Customer Id:
@Repository
public interface OrderRepository extends JpaRepository<Order, Long> {
List<Order> findByCartCustomerId(Long customerId);
}
Expected behavior
This Query Method needs to be working as it is actually working in Spring Boot framework with Spring Data JPA.
Actual behavior
Runtime exception is thrown:
2020-07-08 18:34:00,858 ERROR [io.qua.dep.dev.DevModeMain] (main) Failed to start Quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.spring.data.deployment.SpringDataJPAProcessor#build threw an exception: io.quarkus.spring.data.deployment.UnableToParseMethodException: Entity com.targa.labs.quarkus.myboutique.domain.Order does not contain a field named: CartCustomerId. Offending method is findByCartCustomerId
To Reproduce
Steps to reproduce the behavior:
mvn quarkus:dev
Configuration
quarkus.datasource.db-kind=postgresql
quarkus.hibernate-orm.dialect=org.hibernate.dialect.PostgreSQL10Dialect
quarkus.hibernate-orm.log.sql=true
quarkus.datasource.username=developer
quarkus.datasource.password=p4SSW0rd
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/demo
quarkus.hibernate-orm.database.generation=drop-and-create
Screenshots
None
Environment (please complete the following information):
uname -a
or ver
: Darwin MacBook-Pro-de-Nebrass.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64java -version
: OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)mvnw --version
or gradlew --version
): 3.6.3Additional context
(Add any other context about the problem here.)
/cc @geoand
Thanks for reporting, I'll take a look next week
Thank you @geoand 馃槉
@ebullient in the meantime if you want to have a look, I won't stop you :)
@geoand I made a try for the fix 馃榿 can you take a look please ?
Thanks! I'm on PTO, so I'll check when I get back
Most helpful comment
Thanks! I'm on PTO, so I'll check when I get back