请各位帮忙分析下,详细描述如下:
编写了一个简单的实体类Customer,和一个获取Session的工具类,按照百度搜索的结果,检查了hibernate配置文件和实体类映射文件,均没有问题。但是执行到save方法时即报错Unknown entity。打印获取到的session信息为“SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=ExecutableList{size=0} updates=ExecutableList{size=0} deletions=ExecutableList{size=0} orphanRemovals=ExecutableList{size=0} collectionCreations=ExecutableList{size=0} collectionRemovals=ExecutableList{size=0} collectionUpdates=ExecutableList{size=0} collectionQueuedOps=ExecutableList{size=0} unresolvedInsertDependencies=null])”
younghu
相关分类