-->
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: net.sf.hibernate.PropertyAccessException
PostPosted: Fri Apr 30, 2004 4:55 pm 
Newbie

Joined: Wed Apr 28, 2004 5:22 pm
Posts: 11
Location: United States
Hey all, could someone give me somehelp with the following error:

------------------------------
2004-04-30 16:56:23,673 [tcpConnection-6802-0] ERROR dining - EXCEPTION: net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of edu.udel.dining.beans.Screen1HPBean.setTermid
net.sf.hibernate.PropertyAccessException: exception setting property value with
CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter
of edu.udel.dining.beans.Screen1HPBean.setTermid
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:212)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2199)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:240)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
-----------------------------

I am trying to run a query:

session = HibernateSession.getSessionFactory().openSession(con);
tx = session.beginTransaction();
query = session.createQuery("from edu.udel.dining.beans.Screen1HPBean screen where screen.termid = 'ABC');
Iterator iter = query.iterate();


The query "should" return an object of type Screen1HPBean which contains:
String termid;
Set plans;

the Set plans, is a set of PlanBean objects

Here is my mapping file:

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

<hibernate-mapping schema="web001" package="edu.udel.dining">

<class name="edu.udel.dining.beans.Screen1HPBean" table="dining_screenbean">
<id name="id">
<column name="id" unique="true" not-null="true" sql-type="char"
length="32" />
<generator class="uuid.hex"/>
</id>
<property name="termid" type="char">
<column name="termid" length="3" not-null="true" />
</property>
<set name="plans" lazy="true">
<key column="id" />
<one-to-many class="edu.udel.dining.beans.PlanBean" />
</set>
</class>

<class name="edu.udel.dining.beans.PlanBean" table="dining_planbean">
<id name="id" column="id">
<generator class="uuid.hex"/>
</id>
<property name="mealPlan" type="char" length="1"/>
<property name="blackBoard" type="string"/>
<property name="numberOfMeals" type="string"/>
<property name="semesterAmount" type="string"/>
<property name="pointsAmount" type="string"/>
<property name="traditionalOption" type="int"/>
<property name="nonTraditionalOption" type="int"/>
<property name="allowCancellations" type="int"/>
</class>

</hibernate-mapping>
--------------------------

Thanks for any help in advance,
Luis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 30, 2004 5:00 pm 
Newbie

Joined: Wed Apr 28, 2004 5:22 pm
Posts: 11
Location: United States
Never mind, the property type was not matching with the mapping type String -> char.

Thanks all,
Luis


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.