断点调试的时候:
set 里面是这个错:
com.sun.jdi.InvocationException occurred invoking method后来我改了<hibernate-mapping default-lazy="true">
也不可以 

解决方案 »

  1.   

    改了配置文件后:
            <set name="moduleSet" inverse="true" cascade="save-update" lazy="false">
                    <key column="MODULENO"/>
                    <one-to-many class="cn.com.liandisys.tcg.model.PrjModule"/>
            </set>
    报错变了
    org.hibernate.exception.SQLGrammarException: could not initialize a collection: [cn.com.liandisys.tcg.model.PRJ_PRODUCT.moduleSet#TSDT000001]
    org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
    org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    org.hibernate.loader.Loader.loadCollection(Loader.java:2001)
    org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
    org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
    org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:63)
    org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
    org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
    org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:844)
    org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
    org.hibernate.loader.Loader.doList(Loader.java:2213)
    org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
    org.hibernate.loader.Loader.list(Loader.java:2099)
    org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
    org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
    org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
    cn.com.liandisys.tcg.dao.impl.PrjProductDaoImpl.getTotalCount(PrjProductDaoImpl.java:258)
    cn.com.liandisys.tcg.service.impl.PrjProductServiceImpl.getTotalCoun.........
      

  2.   

    问题好像是处在Hibernet与数据库连接之间