-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Bug or feature Properties with second Char in upcase
PostPosted: Tue Jun 28, 2005 10:43 am 
Newbie

Joined: Tue Jun 28, 2005 10:20 am
Posts: 15
Hello,
here comes a short receipe for reproducing.
What happens to me is the exception: PropertyNotFoundException

in one of our databasetables are Columns with names like
a_col
b_bol
...
A reverse engeneering tool generated the coresponding hbm.xml(see below)and the Java Class:
Code:
public class Foo    {
    private Integer id;
    private java.lang.String aCol;
    private java.lang.Short bCol;
    public java.lang.String getACol(){ return this.aCol;}
    public java.lang.Short getBCol(){ return this.bCol;}
//[..rest of class omitted]
}


After getting the exception i renamed aCol consistently to anCol.
After that i get a PropertyNotFoundException for bCol
What is happening here?
The workaround is clear: I renamed all my properties
Ciao,
Hibernate version:
3.0
Mapping documents:
Code:
<hibernate-mapping package="de.bafz.lims.model">
    <class name="Foo" table="foo"  mutable="false">
      <id name="id" type="integer">
         <generator class="assigned"/>
      </id>
        <property name="aCol" column="A_COL" type="java.lang.String"  not-null="true" />
        <property name="bCol" column="B_COL" type="java.lang.Short" />
    </class>
    </hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
[code]
16:30:46,796 INFO SessionFactoryImpl: building session factory
16:30:46,796 DEBUG SessionFactoryImpl: Session factory constructed with filter configurations : {}
16:30:46,796 DEBUG SessionFactoryImpl: instantiating session factory with properties: [...]
16:30:47,921 ERROR HibernateUtil: Building SessionFactory failed.
org.hibernate.PropertyNotFoundException: Could not find a setter for property aCol in class de.bafz.lims.model.Foo


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.