最贊回答 / qq_22_7
自己已經解決啦,其實還是版本的問題,所以代碼改了一下public void init() { ????????// 創建配置對象? ? ????????ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().configure().build();? ? ? ? //創建會話工廠對象? ? ? ? sessionFactory = new MetadataSources(serviceRegistry).buildM...
2018-01-21
最新回答 / 幕布斯1417581
我試了Address address 改成 Address address1 ? ? component 中的name=address ?改成 name =address1沒報錯呢。
2017-12-29
最新回答 / 慕田峪3481485
用下面的方法創建?sessionFactory 對象吧;好像是版本有更新,空指針異??赡苁瞧渌矫鎸е碌腃onfiguration cfg = new Configuration().configure(); ?ServiceRegistry ?builder= ?(ServiceRegistry) new StandardServiceRegistryBuilde(). ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?...
2017-11-26