java - hibernate reverse engineering persistence unit not found -
i havea java maven3 project in eclipse ide jboss tools installed. i'm using hibenrate4
i'm triing setup hibenrate configuratoin in hibernate view test hql queries, problem is says couldnt find persistence unit. have persistence.xml placed in src/main/resources/meta-inf/persistence.xml
is there maven config nead set?
persistence.xml
<persistence-unit name="ypay"> <provider>org.hibernate.jpa.hibernatepersistenceprovider</provider> <jta-data-source>java:jboss/datasources/ypay</jta-data-source> <properties> <!-- properties hibernate --> <!-- <property name="hibernate.hbm2ddl.auto" value="validate" /> --> <property name="hibernate.show_sql" value="false" /> <property name="hibernate.dialect" value="org.hibernate.dialect.mysqlinnodbdialect" /> </properties> hibernate.properties
hibernate.connection.password= hibernate.connection.username=root hibernate.connection.driver_class=com.mysql.jdbc.driver hibernate.dialect=org.hibernate.dialect.mysqlinnodbdialect hibernate.connection.url=jdbc:mysql://****************:3306/ypay?useunicode=true&characterencoding=utf-8 hibernate.connection.provider_class=org.hibernate.connection.drivermanagerconnectionprovider hibernate.datasource= hibernate.transaction.manager_lookup_class=
you need meta-inf/persistence.xml
<persistence-unit name="ypay"> (usually set in web-inf/classes/meta-inf. when using maven can seek placing in src/main/resources/meta-inf)
please refer this doc details.
java hibernate maven jpa
No comments:
Post a Comment