Quarkus with Panache getting hibernate error HHH000183

I built an application with Quarkus and I’m using Hibernate with Panache for the models. Everything goes well, the application starts, but when I call a webservice to get a list using Panache functionalities (.listAll()), I get an empty list and I see the following message in the console:

HHH000183: no persistent classes found for query class: from com.myproject.model.TeamEntity

My models are defined with @Entity annotations that should allow Hibernate to find by itself the entity mappings. Here is an example with the Team model:

@Table(name = "TEAM")
public class TeamEntity extends PanacheEntityBase {

    @GeneratedValue(strategy = SEQUENCE, generator = "TEAM_SEQ_GEN")
    @SequenceGenerator(name = "TEAM_SEQ_GEN", sequenceName = "TEAM_SEQ", allocationSize = 10)
    @Column(name = "ID_TEAM", nullable = false)
    private int id;

    @Column(name = "NAME", nullable = false)
    private String name;



I don’t have any persistence.xml file in the project, only the application.properties linked with Quarkus. Here are the relevant properties extracted from mine:

quarkus.datasource.jdbc.new-connection-sql=alter session set current_schema=MYSCHEMA

Does someone know where the problem could come from ? Hibernate should detect entities with annotations and use them in queries automatically.


It came out that the problem was on Quarkus Datasource configuration in the application.properties file. More particularly from this specific line to define the schema used at first connection (I have to admit that was not good looking):

quarkus.datasource.jdbc.new-connection-sql=alter session set current_schema=MYSCHEMA

Replacing the line above with the following solved the problem:


In conclusion, I think Hibernate cannot find / does not take the entities defined if this property is not defined, maybe because it makes some kind of detection beforehand. That’s only a supposition, if someone knows more precisely how Hibernate works for that specific case, I would be very interested !