2011-11-01 59 views
0

我需要做一些測試與JPQL,所以我想做到這一點與休眠的工具,但是當我嘗試打開會話工廠出現這樣的:無法找到事務管理如下顯示:如何使用Hibernate工具來執行JPQL查詢?

enter image description here

這裏是我的persistence.xml文件

<?xml version="1.0" encoding="UTF-8"?> 
<persistence version="2.0" 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"> 
    <persistence-unit name="SuaParte"> 
     <jta-data-source>jdbc/suaparte_ds</jta-data-source> 
     <class>entity.Area</class> 
      //classes.. 
     <properties> 
      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> 
      <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/> 
      <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/> 
      <property name="hibernate.connection.datasource" value="jdbc/suaparte_ds"/> 
     </properties> 
    </persistence-unit> 
</persistence> 

回答