I need to enable support of Joda-Time-Hibernate for my application. I use applicatoinContext.xml and Annotations to configure Hibernate.
applicatoinContext.xml
...
<context:annotation-config/>
<tx:annotation-driven/>
...
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/default" />
<property name="username" value="root"/>
<property name="password" value="root"/>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="packagesToScan" value="ee.test.mysql"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"
p:sessionFactory-ref="sessionFactory">
</bean>
</beans>
Where to add <property type="org.joda.time.contrib.hibernate.PersistentDateTime" name="dateTime"/>? Is there a way to use applicatioContext.xml, Annotations and get database properties from database.properties?
No comments:
Post a Comment