MY FAULT, STILL LEARNING. Don't bother yourself about this. I have just
figured out how to properly use persistence.xml with non-jta-data-source. In
above post I haven't configured data source, and my persistence.xml was not
valid for use with non-jta-data-source. 

Now, I have defined data source in <tomee>/conf/tomee.xml as:

<Resource id="mySQLDataSource" type="DataSource">
    JdbcDriver          com.mysql.jdbc.Driver
    JdbcUrl             jdbc:mysql://127.0.0.1:3306/xyDB
    UserName            root
    Password            123
    JtaManaged      false
    DefaultAutoCommit   false
</Resource>

Also, persistence unit was being removed during server startup (got WARNING
messages), because its connection properties  were "not valid in a container
environment". 

So, with defined datasource (above), persistence unit in persistence.xml
looks like:

  <persistence-unit name="Vezbe07Primer02"
transaction-type="RESOURCE_LOCAL">
   
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>

        <non-jta-data-source>mySQLDataSource</non-jta-data-source>

    <properties>
      <property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)" />
      <property name="openjpa.jdbc.DBDictionary" value="mysql" />
      <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO" />
    </properties>
  </persistence-unit>
  
</persistence>

With these configurations, I am getting mysql tables generated from
annotated entities.



--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Persistence-xml-configuration-OpenJPA-not-mapping-entities-to-mysql-db-tp7585208p7585237.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to