hibernate-Unable to resolve property: id,Hibernate异常

问题描述

Unable to resolve property: id,Hibernate异常
 org.hibernate.HibernateException: Unable to resolve property: id
    org.hibernate.tuple.entity.EntityMetamodel.getPropertyIndex(EntityMetamodel.java:487)
    org.hibernate.persister.entity.AbstractEntityPersister.getPropertyIndex(AbstractEntityPersister.java:1684)
    org.hibernate.engine.EntityEntry.getLoadedValue(EntityEntry.java:233)
    org.hibernate.type.CollectionType.getKeyOfOwner(CollectionType.java:363)
    org.hibernate.type.CollectionType.resolve(CollectionType.java:424)
    org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:139)
    org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)
    org.hibernate.loader.Loader.doQuery(Loader.java:752)
    org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    org.hibernate.loader.Loader.loadEntity(Loader.java:1885)
    org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
    org.hibernate.loader.entity.EntityLoader.loadByUniqueKey(EntityLoader.java:108)
    org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:1662)
    org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:641)
    org.hibernate.type.EntityType.resolve(EntityType.java:415)
    org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:139)
    org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)
    org.hibernate.loader.Loader.doQuery(Loader.java:752)
    org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
    org.hibernate.loader.Loader.loadEntity(Loader.java:1885)
    org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
    org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
    org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3062)
    org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434)
    org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415)
    org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
    org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:121)
    org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:906)
    org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:864)
    org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:141)
    org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:174)
    org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
    com.znyy.bean.lis.LisTm_$$_jvst3fe_1a.getZyyzjymx(LisTm_$$_jvst3fe_1a.java)
    com.znyy.service.lis.LisBBServiceImpl.getXtJyLisBbdj(LisBBServiceImpl.java:224)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:601)
    org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    sun.proxy.$Proxy11.getXtJyLisBbdj(Unknown Source)
    com.znyy.action.lis.LisBBAction.getXtJyLisBbdj(LisBBAction.java:229)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:601)
    com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)
    com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)
    com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
    org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:270)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
    com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
    org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

解决方案

hibernate could not resolve property
HOWTO: Recover the Problem of fschk.exe : unable to resolve UUID=”
Unable to resolve target 'android-17'

时间: 2024-12-23 15:39:30

hibernate-Unable to resolve property: id,Hibernate异常的相关文章

struts2-Hibernate Struts JSP 问题 could not resolve property

问题描述 Hibernate Struts JSP 问题 could not resolve property org.hibernate.QueryException: could not resolve property: factorycalendar.aparticularYear of: MyHibernate.Mps at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(Abstract

org.hibernate.QueryException: could not resolve property: title of:求解决hql

问题描述 org.hibernate.QueryException: could not resolve property: title of:求解决hql org.hibernate.QueryException: could not resolve property: title of: com.head.oa.affairs.archivemanage.entity.ArchiveInfo [select count(*) from com.head.oa.affairs.archivem

hibernate save-hibernate执行保存对象时出现异常:org.hibernate.exception.GenericJDBCException

问题描述 hibernate执行保存对象时出现异常:org.hibernate.exception.GenericJDBCException hibernate执行保存对象时出现异常:org.hibernate.exception.GenericJDBCException: could not insert: [com.hibernate.domain.User] Caused by: java.sql.SQLException: Field 'user_id' doesn't have a d

hibernate 怎么配置oracle的id生成策略

问题描述 hibernate 怎么配置oracle的id生成策略 之前使用hibernate连接mysql,后来需要转为oracle. 原来: mysql的id设置为自增, hibernate中对应的自增策略 @GeneratedValue(strategy=GenerationType.IDENTITY) private int userId; 现在: oracle中的id使用序列加触发器实现了插入前自增 但是现在hibernate中应该怎么配置? 解决方案 @GeneratedValue(s

Hibernate是怎么拿到id的?

问题描述 言简意赅:new 一个实体类 比如叫 a 然后session.save(a)然后a就有了一个id(id是Long, generator是native)我的问题是Hibernate是怎么得到这个id的在oracle中 可以 select hibernate_sequence.nextval from dual 得到那么像mysql这种auto_increment的id, Hibernate又是怎么得到这个id的呢?其实我想知道: 如果我用jdbc保存一条记录 我怎么知道我保存的这条记录的

【HIBERNATE框架开发之一】搭建HIBERNATE环境并成功运行第一个项目HELLOHIBERNATE并解决3个常出现的运行问题;

本站文章均为 李华明Himi 原创,转载务必在明显处注明:  转载自[黑米GameDev街区] 原文链接: http://www.himigame.com/hibernate/783.html OK,从这篇开始Himi将与大家一起进入Hibernate框架的学习啦,新手新手的说,希望大家多多指教: 对于Hibernate概述一下: "  Hibernate是一个开放源代码的对象关系映射框架,它对JDBC进行了非常轻量级的对象封装,使得Java程序员可以随心所欲的使用对象编程思维来操纵数据库. H

Hibernate 中get()和load()与Hibernate简介

hibernate 中get()和load()与hibernate简介 session先判断对象是否存在,如果存在就不到数据库教程中检索.返回的对象都位于session缓存中,接下来修改了持久化对象的属性后,当session清理缓存时,会根据持久化对象的属性变化来同步更新数据库.     区别:    (1)当数据库中不存在与oid对应的记录时,load()方法抛出objectnotfoundexception异常,而get()方法返回null.    (2)两者采用不同的检索策略.     

【HIBERNATE框架开发之九】HIBERNATE 性能优化笔记!(遍历、一级/二级/查询/缓存、乐观悲观锁等优化算法)

本站文章均为 李华明Himi 原创,转载务必在明显处注明:  转载自[黑米GameDev街区] 原文链接: http://www.himigame.com/hibernate/825.html 1.   循环分页或者循环进行部分读取处理数据的时候,使用 session.clear() ;   2.    对应1+N(N+1)问题使用如下解决方式: 1): 使用createCriteria进行查询(join fetch) 2):HQL -> join fetch 3): 使用@fetch设置LAZ

SharePoint 2013 Error - TypeError: Unable to get property 'replace' of undefined or null reference

错误信息 TypeError: Unable to get property 'replace' of undefined or null referenceTypeError: Unable to get property 'replace' of undefined or null reference TypeError: Unable to get property 'replace' of undefined or null referenceTypeError: Unable to g