0

I am trying to build hibernate project and i have mentioned properties in

cron.expr=* 12 15 * * ?

quarkus.datasource.driver=oracle.jdbc.driver.OracleDriver
quarkus.hibernate-orm.dialect=oracle.jdbc.driver.OracleDriver
quarkus.datasource.ergo.url=jdbc:oracle:thin:@myhost:1521:orcl
quarkus.datasource.ergo.driver=oracle.jdbc.driver.OracleDriver
quarkus.datasource.ergo.username=quarkus_test
quarkus.datasource.ergo.password=quarkus_test

quarkus.datasource.mds.url=jdbc:oracle:thin:@myhost:1521:orcl
quarkus.datasource.mds.driver=oracle.jdbc.driver.OracleDriver
quarkus.datasource.mds.username=quarkus_test
quarkus.datasource.mds.password=quarkus_test

After running it is giving following message in info:

HHH000318: Could not find any META-INF/persistence.xml file in the classpath

What shall i write in persistance.xml? How quakus persistance.xml will look like? Is it really required when we are giving @Datasource annotation within java class

Following is persistance.xml in previous project deployed in wildfly:

<persistence version="2.1"
             xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">

    <persistence-unit name="ePU" transaction-type="JTA">
        <jta-data-source>java:/datasources/EDS</jta-data-source>
    </persistence-unit>

    <persistence-unit name="mPU" transaction-type="JTA">
        <jta-data-source>java:/datasources/MDS</jta-data-source>
    </persistence-unit>

</persistence>
fatherazrael
  • 5,511
  • 16
  • 71
  • 155

1 Answers1

1

persistence.xml is optional, this is just an INFO message from Hibernate that you can safely ignore.

Quarkus bootstrap Hibernate at build time without the need to a persistence.xml file, you can add it if you want for extended configuration but in most cases this is not needed.

loicmathieu
  • 5,181
  • 26
  • 31