-->
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: How to map primitive type property to allow to take NULL
PostPosted: Mon Jan 28, 2008 11:31 am 
Newbie

Joined: Wed Dec 19, 2007 11:04 am
Posts: 10
Hi,

I have a field in SQL DB as integer type; so i have kept int type property in my model to hold the values.

But the field in the DB can have value "NULL" since it is optional field. When i run select query and try to save in the MODEL, i am getting following error.

"PropertyAccessException: Null value was assigned to a property of primitive type setter"

I have kept the following code on top of the field.


@Column(nullable=true)
int uiAdjId;


Still i am getting same error.

Please help me to resolve this.

Thanks,
Laks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 28, 2008 11:38 am 
Newbie

Joined: Wed Dec 19, 2007 11:04 am
Posts: 10
Sorry,

i apologize for duplicate post. Some network issue.

Thanks,
Laks


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.