[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2925?page=c...
]
Gail Badner commented on HHH-2925:
----------------------------------
Please attach a runnable test case (Java + mapping).
Property with access=noop results in
org.hibernate.PropertyNotFoundException
----------------------------------------------------------------------------
Key: HHH-2925
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2925
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.4.sp1
Environment: Hibernate 3.2.4.sp1, MSSQL/2005, MS sqljdbc-1.0 driver
Reporter: H. Duong
A property with attribute access="noop" results in an exception being thrown:
org.hibernate.PropertyNotFoundException
I have the following property declared:
<property name="errorCount" formula="(SELECT COUNT(*) FROM ECLError
WHERE AbstractDeliveryIID = abstractDeliveryIID)" access="noop"/>
Even declaring the property with attribute insert="false" &
update="false" results in the same exception being thrown:
<property name="errorCount" formula="(SELECT COUNT(*) FROM ECLError
WHERE AbstractDeliveryIID = abstractDeliveryIID)" access="noop"
insert="false" update="false"/>
Here is the exception stacktrace (I have replaced the actual classname with
XXX_CLASSNAME_XXX:
org.hibernate.PropertyNotFoundException: field [errorCount] not found on
XXX_CLASSNAME_XXX
org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:122)
org.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:114)
org.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:137)
org.hibernate.util.ReflectHelper.getter(ReflectHelper.java:83)
org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:71)
org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2174)
org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2151)
org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2041)
org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:359)
org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
org.hibernate.cfg.Configuration.add(Configuration.java:669)
org.hibernate.cfg.Configuration.addInputStream(Configuration.java:504)
org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:656)
org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:82)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
org.apache.catalina.startup.Catalina.start(Catalina.java:551)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira