Spring 配置文件如下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="serviceManager" class="org.springframework.context.support.ClassPathXmlApplicationContext">
<constructor-arg>
<list>
<value>templateLayoutContext.xml</value>
<value>dictionaryContext.xml</value>
<value>dataAccessContext.xml</value>
<value>securityContext.xml</value>
<value>contentContext.xml</value>
<value>scheduleContext.xml</value>
<value>surveyContext.xml</value>
<value>componentContext.xml</value>
<value>videoContext.xml</value>
</list>
</constructor-arg>
</bean>
</beans>
其中 dataAccessContext.xml 是 hibernate 的一些配置。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- ========================= GENERAL DEFINITIONS ========================= -->
<!-- Message source for this context, loaded from localized "messages_xx" files -->
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"><value>messages</value></property>
</bean>
<!-- ========================= Start of PERSISTENCE DEFINITIONS ========================= -->
<!-- NOTE: Choose exactly 1 "dataSource" bean and 1 dialect for the "sessionFactory" -->
<!-- Oracle JNDI DataSource for J2EE environments -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"><value>java:comp/env/jdbc/cmsPool</value></property>
</bean>
<!-- Hibernate SessionFactory for Oracle -->
<!-- for oracle 9i -->
<!--
< bean id="nativeJdbcExtractor" lazy-init="true" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor" />
< bean id="lobHandler" lazy-init="true" class="org.springframework.jdbc.support.lob.OracleLobHandler">
< property name="nativeJdbcExtractor">
< ref bean="nativeJdbcExtractor"/>
</property >
</bean >
-->
<!-- for other databases exception oracle 9i -->
<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true" />
<!-- Choose the dialect that matches your "dataSource" definition -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<value>taskjob-hbm.xml,siteMgt-hbm.xml,templateLayout-hbm.xml,sms-hbm.xml,message-hbm.xml,user-hbm.xml,schedule-hbm.xml,content-hbm.xml,log-hbm.xml,visitlog-hbm.xml,survey-hbm.xml,repository-hbm.xml,workflow-hbm.xml,component-hbm.xml,video-hbm.xml,videoRepository-hbm.xml</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</prop>
<prop key="hibernate.show_sql">false</prop>
</props>
</property>
<!-- lyg 2011-07-18 -->
<property name="lobHandler" ref="lobHandler" />
<!-- for oracle 9i -->
<!--
< property name="lobHandler">
< ref local="lobHandler" />
</property >
-->
</bean>
...
</beans>
请问各位,我应该如何设置 idea ,才能让 idea 关联上我的这些配置呢?
1
echo1937 2016-12-06 16:05:33 +08:00
原来还有这个节点啊,帮你顶下以示支持。
|
2
runcelim 2016-12-06 16:24:00 +08:00
哎,这也是我脱离 J2EE 的原因,一堆配置,身边没有老鸟,个人摸索太低效
|
3
letitbesqzr 2016-12-06 17:22:39 +08:00 1
|
4
340244120 OP @letitbesqzr 刚刚自己琢磨着解决了,一样的步骤。不过还是十分感谢!
|