davidhe1127 wrote:
hi
Firstly, you can press "Ctrl+Shift+T" and then type the
EntityManagerFactory in the
textfield sitting in the pop-up dialog box. If you find it, that is a good news indicating you have already loaded the correct jar file.
So, you can then take a reference of my one.
I post it below.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!-- Datasource and Connection Pool Configuration -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="jdbcUrl">
<value>jdbc:mysql://localhost:3306/aip?useUnicode=true&characterEncoding=utf8&autoReconnect=true&autoReconnectForPools=true</value>
</property>
<property name="user">
<value>XinGuan</value>
</property>
<property name="password">
<value>52230365</value>
</property>
<property name="maxPoolSize">
<value>40</value>
</property>
<property name="minPoolSize">
<value>1</value>
</property>
<property name="initialPoolSize">
<value>1</value>
</property>
<property name="maxIdleTime">
<value>20</value>
</property>
</bean>
<!-- SessionFactory Configuration -->
<bean id="mySessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>com/cn/pojo/Order.hbm.xml</value>
<value>com/cn/pojo/Customer.hbm.xml</value>
<value>com/cn/pojo/Product.hbm.xml</value>
<value>com/cn/pojo/OrderProduct.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="current_session_context_class">thread</prop>
<prop key="hibernate.cache.provider_class">
org.hibernate.cache.EhCacheProvider
</prop>
<prop key="connection.pool_size">10</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
Hope it helps.
Sorry David,
I dint get u ....
couple of things i want know
1)is its problem of multiple jars loaded?
2)is its problem of persistance.xml issue?
3)How many files need apart from (pojo class,jpaclient.java and persistance.xml)?
thanks in advance
hibernaterobot