-->
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: variable naming convention
PostPosted: Tue Apr 26, 2005 5:25 am 
Newbie

Joined: Tue Apr 26, 2005 5:08 am
Posts: 1
Hi,
I have created pojo hibtut.eg.pojo.Utente with an member attribute "sId" and created the mapping files as given below. When i run the application it gives "no getter method found for sId" error message, whereas i have written getter and setter methods(getSId() and setSId(String)).

Now if i change the variable name case to "sid" and method prototype to getSid() and setSid(String), it runs without any problem.

Is there any standard for creating Pojos?

Hibernate version: 2.0


Mapping documents:

<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="hibtut.eg.pojo.Utente" table="UTENTE">
<id name="sId" type="string" unsaved-value="null" >
<column name="UTENTE_ID" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
</class>
</hibernate-mapping>



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


Full stack trace of any exception that occurs:

Exception in thread "main" java.lang.ExceptionInInitializerError
at hibtut.eg.util.HibernateUtil.<clinit>(HibernateUtil.java:31)
at hibtut.eg.main.Main.main(Main.java:25)
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for
sId in class hibtut.eg.pojo.Utente
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicProper
tyAccessor.java:213)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyA
ccessor.java:207)
at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:14
8)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyF
actory.java:41)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:104)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntit
yPersister.java:398)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(Sing
leTableEntityPersister.java:104)
at org.hibernate.persister.PersisterFactory.createClassPersister(Persist
erFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:
199)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1043)
at hibtut.eg.util.HibernateUtil.<clinit>(HibernateUtil.java:27)
... 1 more




Name and version of the database you are using:

SQL Server 2000





Regards,
Kalai.


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.