net.sf.hibernate.PropertyNotFoundException: field not found: maptainId_0_1_2_3_4_5_6_7_8_9

Hibernate JIRA | Alfonso da Silva | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Hi! Section "5.1.5. composite-id" of the "Hibernate Reference Documentation 2.1.3" says that, in a hibernate mapping file, 'composite-id' tag accepts 'access' attribute. I have defined my own PropertyAccessor class and I have used 'access' attribute in my hibernate mapping file, but there is 'PropertyNotFoundException' because hibernate uses 'DirectPropertyAccessor' class and not my PropertyAccessor implementation. This is my hibernate mapping file: --------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"><hibernate-mapping><class name='$java.util.HashMap$$EnhancerByCGLIB$$8d83d369' table='maptain_junit_0'><composite-id name='maptainId_0_1_2_3_4_5_6_7_8_9' class='net.sf.maptain.impl.hibernate.Id' access='net.sf.maptain.impl.hibernate.MapCompositeIdAccesor'><key-property name='long' type='long' column='foo_long' access='net.sf.maptain.impl.hibernate.MapKeyPropertyAccesor'/></composite-id><property name='byte' type='byte' column='foo_byte' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='short' type='short' column='foo_short' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='integer' type='integer' column='foo_integer' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='float' type='float' column='foo_float' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='double' type='double' column='foo_double' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='boolean' type='boolean' column='foo_boolean' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='character' type='character' column='foo_character' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='string' type='string' column='foo_string' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/></class></hibernate-mapping> --------------------------------------------------------------- and this is the exception: --------------------------------------------------------------- net.sf.hibernate.PropertyNotFoundException: field not found: maptainId_0_1_2_3_4_5_6_7_8_9 at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:74) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:88) at net.sf.hibernate.util.ReflectHelper.getter(ReflectHelper.java:81) at net.sf.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:90) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:286) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249) at net.sf.hibernate.cfg.Configuration.addXML(Configuration.java:206) --------------------------------------------------------------- Thankx!

    Hibernate JIRA | 1 decade ago | Alfonso da Silva
    net.sf.hibernate.PropertyNotFoundException: field not found: maptainId_0_1_2_3_4_5_6_7_8_9
  2. 0

    Hi! Section "5.1.5. composite-id" of the "Hibernate Reference Documentation 2.1.3" says that, in a hibernate mapping file, 'composite-id' tag accepts 'access' attribute. I have defined my own PropertyAccessor class and I have used 'access' attribute in my hibernate mapping file, but there is 'PropertyNotFoundException' because hibernate uses 'DirectPropertyAccessor' class and not my PropertyAccessor implementation. This is my hibernate mapping file: --------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"><hibernate-mapping><class name='$java.util.HashMap$$EnhancerByCGLIB$$8d83d369' table='maptain_junit_0'><composite-id name='maptainId_0_1_2_3_4_5_6_7_8_9' class='net.sf.maptain.impl.hibernate.Id' access='net.sf.maptain.impl.hibernate.MapCompositeIdAccesor'><key-property name='long' type='long' column='foo_long' access='net.sf.maptain.impl.hibernate.MapKeyPropertyAccesor'/></composite-id><property name='byte' type='byte' column='foo_byte' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='short' type='short' column='foo_short' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='integer' type='integer' column='foo_integer' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='float' type='float' column='foo_float' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='double' type='double' column='foo_double' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='boolean' type='boolean' column='foo_boolean' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='character' type='character' column='foo_character' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='string' type='string' column='foo_string' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/></class></hibernate-mapping> --------------------------------------------------------------- and this is the exception: --------------------------------------------------------------- net.sf.hibernate.PropertyNotFoundException: field not found: maptainId_0_1_2_3_4_5_6_7_8_9 at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:74) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:88) at net.sf.hibernate.util.ReflectHelper.getter(ReflectHelper.java:81) at net.sf.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:90) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:286) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249) at net.sf.hibernate.cfg.Configuration.addXML(Configuration.java:206) --------------------------------------------------------------- Thankx!

    Hibernate JIRA | 1 decade ago | Alfonso da Silva
    net.sf.hibernate.PropertyNotFoundException: field not found: maptainId_0_1_2_3_4_5_6_7_8_9

    Root Cause Analysis

    1. net.sf.hibernate.PropertyNotFoundException

      field not found: maptainId_0_1_2_3_4_5_6_7_8_9

      at net.sf.hibernate.property.DirectPropertyAccessor.getField()
    2. net.sf.hibernate
      Configuration.addXML
      1. net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:74)
      2. net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80)
      3. net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80)
      4. net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80)
      5. net.sf.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:88)
      6. net.sf.hibernate.util.ReflectHelper.getter(ReflectHelper.java:81)
      7. net.sf.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:90)
      8. net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:286)
      9. net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
      10. net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
      11. net.sf.hibernate.cfg.Configuration.addXML(Configuration.java:206)
      11 frames