Hi All,
I am trying to test the following code:
Code:@Transactional public void updateT(Testtbl pTest) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("test"); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.createNativeQuery( "UPDATE Testtbl e SET e.firstName = 'xxx'").executeUpdate(); em.getTransaction().commit(); em.close(); emf.close(); }
As you can see this method may update my Testbl table, but when I run the project, the websphere consol returns the following error:
The file where I configure the persistence is named META-INF/spring-persistence.xmlCode:org.hibernate.ejb.Ejb3Configuration configure Could not find any META-INF/persistence.xml file in the classpath
my spring-persistence.xml is the following:
Any help will be greatly appreciated.Code:<?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="test" transaction-type="RESOURCE_LOCAL"> <!-- provider --> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.format_sql" value="true"/> <property name="use_sql_comments" value="false"/> <property name="hibernate.dialect" value="org.hibernate.dialect.InformixDialect" /> </properties> </persistence-unit> </persistence>
Thanks and Regards,
Student


Reply With Quote