-->
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.  [ 2 posts ] 
Author Message
 Post subject: JavaBeans Mapping Error for setter/getter
PostPosted: Tue Sep 28, 2004 5:20 am 
Newbie

Joined: Fri Mar 05, 2004 1:49 am
Posts: 1
Hibernate version:
2.1.2
Database Used
Informix
Database Dialect Used
InformixDialect
Class Used for Mapping
public class MQFWHostDetails
{
private int qMgrId=-1;

public int getQMgrId()
{
return qMgrId;
}

public void setQMgrId(int i)
{
qMgrId = i;
}

}

Mapping documents:
<?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="MQFWHostDetails" table="mqfw_host_details">
<id name="qMgrId" column="queue_manager_id" unsaved-value="-1" >
<generator class="identity"/>
</id>
</class>
</hibernate-mapping>

Full stack trace of any exception that occurs:
net.sf.hibernate.PropertyNotFoundException: Could not find a setter for property qMgrId in class MQFWHostDetails
at net.sf.hibernate.property.BasicPropertyAccessor.getSetter(BasicPropertyAccessor.java:131)
at net.sf.hibernate.mapping.Property.getSetter(Property.java:182)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:577)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:715)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:750)
at IfxTest.main(IfxTest.java:14)

Description
According to Java bean standard the setter for attribute qMgrId is setQMgrId. But for some reason Hibernate fails to find the setter and i get the above mentioned exception.
However when i change the value of the name attibute of the id element in the Mapping XML document to QMgrId('q' in capital) then everything works fine.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 10:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
http://www.hibernate.org/116.html#A30


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

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.