I am attempting to generate the JPA metamodel from the Hibernate mapping configuration (.hbm.xml) using JDK 8 and Hibernate 5.2.0. From the output I see it is finding the Hibernate Static Metamodel generator, but it does not appear to be detecting my processor options or reading the Hibernate mapping file, as no Metamodel source files are generated.
Here is the command line:
javac -verbose -d "C:\Development\delta\delta\PjmBackend\interim\metamodel"
-classpath "C:\Development\delta\delta\PjmBackend\interim\metamodel;C:\Development\delta\delta\PjmBackend\metamodel;C:\Development\delta\delta\lib\build\jpa-metamodel-generator-2.0\hibernate-jpamodelgen-5.2.0.Final.jar"
-sourcepath "C:\Development\delta\delta\PjmBackend\src"
-proc:only -processor org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
-Adebug=true -AaddGeneratedAnnotation=true
com\leeriver\trading\pjm\data\ActiveConstraint.java
Here is my META-INF/persistence.xml:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="com.leeriver.trading.pjm.data.metamodel">
<description>
Metamodel generation for Hibernate mappings
</description>
<non-jta-data-source>java:app/datasources/MySqlPjmDS</non-jta-data-source>
<mapping-file>com/leeriver/trading/pjm/data/PjmMarketData.hbm.xml</mapping-file>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL57InnoDBDialect" />
</properties>
</persistence-unit>
</persistence>
and META-INF/orm.xml:
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
version="2.0">
<persistence-unit-metadata>
<xml-mapping-metadata-complete/>
</persistence-unit-metadata>
</entity-mappings>
This ouput demonstrates the correct Static Metamodel generator is being used:
Note: Hibernate JPA 2 Static-Metamodel Generator 5.2.0.Final
I get this warning from the output:
warning: The following options were not recognized by any processor: '[debug, addGeneratedAnnotation]'
I've added the -verbose flag to javac and the -Adebug=true does not appear to be detected. Am I missing something for invoking the processor? Is there some way I can debug the processor invocation within javac to see if it is processing the input files?