Spring 融合 hibernate 后,如何让 intellij idea 识别相关配置呢? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
340244120
V2EX    JetBrains

Spring 融合 hibernate 后,如何让 intellij idea 识别相关配置呢?

  •  
  •   340244120 2016-12-06 16:03:17 +08:00 4978 次点击
    这是一个创建于 3286 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Spring 配置文件如下

    <?xml versio="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 关联上我的这些配置呢?

    4 条回复    2016-12-06 17:39:58 +08:00
    echo1937
        1
    echo1937  
       2016-12-06 16:05:33 +08:00
    原来还有这个节点啊,帮你顶下以示支持。
    runcelim
        2
    runcelim  
       2016-12-06 16:24:00 +08:00
    哎,这也是我脱离 J2EE 的原因,一堆配置,身边没有老鸟,个人摸索太低效
    letitbesqzr
        3
    letitbesqzr  
       2016-12-06 17:22:39 +08:00   1
    340244120
        4
    340244120  
    OP
       2016-12-06 17:39:58 +08:00
    @letitbesqzr 刚刚自己琢磨着解决了,一样的步骤。不过还是十分感谢!
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2797 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 24ms UTC 02:29 PVG 10:29 LAX 18:29 JFK 21:29
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86