Multiple persistence.xml files?

Hello all:

My Cuba 7.2 project seems to have more than one persistence.xml file. I have one located my global module and another that is in a project root/META-INF directory? They are also different:

global module:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             version="2.0">
    <persistence-unit name="rade"
                      transaction-type="RESOURCE_LOCAL">
        <class>com.paslists.rade.entity.Batchhdr</class>
        <class>com.paslists.rade.entity.Batchload</class>
        <class>com.paslists.rade.entity.BatchloadControl</class>
        <class>com.paslists.rade.entity.Batchrpt</class>
        <class>com.paslists.rade.entity.CodeControl</class>
        <class>com.paslists.rade.entity.Company</class>
        <class>com.paslists.rade.entity.Control</class>
        <class>com.paslists.rade.entity.Customer</class>
        <class>com.paslists.rade.entity.Dummyitem</class>
        <class>com.paslists.rade.entity.Game</class>
        <class>com.paslists.rade.entity.Item</class>
        <class>com.paslists.rade.entity.Line</class>
        <class>com.paslists.rade.entity.RadeList</class>
        <class>com.paslists.rade.entity.Mailfile</class>
        <class>com.paslists.rade.entity.Mailing</class>
        <class>com.paslists.rade.entity.Offer</class>
        <class>com.paslists.rade.entity.OfferCost</class>
        <class>com.paslists.rade.entity.Product</class>
        <class>com.paslists.rade.entity.ProdControl</class>
        <class>com.paslists.rade.entity.ProdInventory</class>
        <class>com.paslists.rade.entity.ProdLineitem</class>
        <class>com.paslists.rade.entity.ProdLocation</class>
        <class>com.paslists.rade.entity.ProdReceipt</class>
        <class>com.paslists.rade.entity.ProdShipper</class>
        <class>com.paslists.rade.entity.ProdSupplier</class>
        <class>com.paslists.rade.entity.ProdTrans</class>
        <class>com.paslists.rade.entity.RaNote</class>
        <class>com.paslists.rade.entity.Rule</class>
        <class>com.paslists.rade.entity.Schematic</class>
        <class>com.paslists.rade.entity.SchematicStateOmit</class>
        <class>com.paslists.rade.entity.Segment</class>
        <class>com.paslists.rade.entity.Sourcecodes</class>
        <class>com.paslists.rade.entity.SourceWo</class>
        <class>com.paslists.rade.entity.Step</class>
        <class>com.paslists.rade.entity.Suppitem</class>
        <class>com.paslists.rade.entity.Updtrans</class>
        <class>com.paslists.rade.entity.UserCompany</class>
        <class>com.paslists.rade.entity.Winlot</class>
        <class>com.paslists.rade.entity.Winner</class>
        <class>com.paslists.rade.entity.key.OfferCostCompKey</class>
        <class>com.paslists.rade.entity.key.CodeControlCompKey</class>
        <class>com.paslists.rade.entity.key.ProdReceiptsCompKey</class>
        <class>com.paslists.rade.entity.key.ResponseCurveCompKey</class>
        <class>com.paslists.rade.entity.key.SchematicstateomitsCompKey</class>
        <class>com.paslists.rade.entity.key.SubStatsCompKey</class>
        <class>com.paslists.rade.entity.key.SchematicstateomitsCompKey</class>
        <class>com.paslists.rade.entity.key.OrderStatsCompKey</class>
        <class>com.paslists.rade.entity.Currency</class>
        <class>com.paslists.rade.entity.BooleanTFConverter</class>
        <class>com.paslists.rade.entity.Country</class>
        <class>com.paslists.rade.entity.CategoryStats</class>
        <class>com.paslists.rade.entity.ProductStats</class>
        <class>com.paslists.rade.entity.OfferStats</class>
        <class>com.paslists.rade.entity.SourceStats</class>
        <class>com.paslists.rade.entity.RtypeHist</class>
        <class>com.paslists.rade.entity.MailingStats</class>
        <class>com.paslists.rade.entity.ProductRespStats</class>
        <class>com.paslists.rade.entity.ResponseCurve</class>
        <class>com.paslists.rade.entity.Cusnetpl</class>
        <class>com.paslists.rade.entity.Skutable</class>
        <class>com.paslists.rade.entity.SkuStats</class>
        <class>com.paslists.rade.entity.SubStats</class>
        <class>com.paslists.rade.entity.OrderStats</class>
        <class>com.paslists.rade.entity.Ordersource</class>
        <class>com.paslists.rade.entity.Assemblyskus</class>
        <class>com.paslists.rade.entity.Assemblyskutrans</class>
        <class>com.paslists.rade.entity.FindResp</class>
        <class>com.paslists.rade.entity.Response</class>
        <class>com.paslists.rade.entity.Skulist</class>
        <class>com.paslists.rade.entity.AutoshipFunnel</class>
        <class>com.paslists.rade.entity.FunnelStats</class>
        <class>com.paslists.rade.entity.CostHistory</class>
    </persistence-unit>
</persistence>

project-root/META-INF:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence 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_2.xsd"
             version="2.2">

    <persistence-unit name="NewPersistenceUnit">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <properties>
            <property name="eclipselink.jdbc.url" value=""/>
            <property name="eclipselink.jdbc.driver" value=""/>
            <property name="eclipselink.jdbc.user" value=""/>
            <property name="eclipselink.jdbc.password" value=""/>
        </properties>
    </persistence-unit>
</persistence>

This second one seems to be incorrect and superfluous. org.eclipse.persistence.jpa.PersistenceProvider can’t even be located according to Intellij (it’s red).

Can I just delete it? Any idea where it might have come from?

Hi,
File from the META-INF looks like some file that IntelliJ IDEA Ultimate likes to automatically create when you setup the Persistence facet in the project.
It can be safely deleted.

Thank you.