-->
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: Why I Get PropertyAccessException
PostPosted: Thu Sep 04, 2003 3:01 am 
Beginner
Beginner

Joined: Thu Sep 04, 2003 2:52 am
Posts: 29
java bean:
--------------------
public class RuntimeParameter {

private int id;
private int fid;
private int cid;
private String oid;
private String pname;
private String dname;
private int rw;
private String dtype;
private int itype;
private String desc;
...
}
//every property has a getter and setter

mapping xml:
---------------------
<id name="id" column="ID" unsaved-value="0">
<generator class="assigned">
</generator>
</id>
<property name="pname" column="PName"/>
<property name="dname" column="DName"/>
<property name="dtype" column="DType"/>
<property name="itype" column="IType"/>
<property name="oid" column="OID"/>
<property name="fid" column="FID"/>
<property name="cid" column="CID"/>
<property name="rw" column="RW"/>
<property name="desc" column="DESCRIPTION"/>

core code
---------------
List list = session.find("from RuntimeParameter");

core exception
------------------
java.lang.NullPointerException

at RuntimeParameterMetaClass7.setPropertyValues(<generated>)

at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:158)

at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1964)

at net.sf.hibernate.loader.Loader.doFind(Loader.java:196)

at net.sf.hibernate.loader.Loader.find(Loader.java:604)


rethrown as net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB setter of RuntimeParameter.?

at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:163)

at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1964)

at net.sf.hibernate.loader.Loader.doFind(Loader.java:196)

at net.sf.hibernate.loader.Loader.find(Loader.java:604)

Caused by: java.lang.NullPointerException

at com.lianchuang.smartsecurer.sr.RuntimeParameterMetaClass7.setPropertyValues(<generated>)

at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:158)

... 27 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 04, 2003 3:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You are mapping a primitive type to a nullable database column.


Java primitives cannot represent null values.


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.