日期:2014-05-19  浏览次数:20746 次

关于OPENJPA的问题.
XML code
<?xml version="1.0"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">  
    <persistence-unit name="openjpa">
        <provider>org.apache.openjpa.persistence.PersistenceProviderImpl
        </provider>
        <class>test.School</class>
        <class>test.Student</class>
        <properties>
            <property name="openjpa.ConnectionURL" 
                value="jdbc:mysql://localhost:3306/test" />
            <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver" />
            <property name="openjpa.ConnectionUserName" value="root" />
            <property name="openjpa.ConnectionPassword" value="root" />
            <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO" />
            <property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
            <property name="openjpa.jdbc.SynchronizeMappings" 
                value="buildSchema(ForeignKeys=true)"/>
        </properties>
    </persistence-unit>
</persistence>

再persistence标签里, 有一个属性version="1.0", 不是说jpa已经升级2.0了吗? 
还有openjpa的enhancer是什么, 怎么用?

------解决方案--------------------
jpa是已经到2.0了。看你用的是什么,