-->
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.  [ 3 posts ] 
Author Message
 Post subject: Can't NUMBER type fields be nullable fields in Oracle
PostPosted: Tue Jan 10, 2006 9:27 am 
Newbie

Joined: Sat Dec 24, 2005 8:39 am
Posts: 15
Can't NUMBER type fields be nullable fields in Oracle

In mapping i gave the type as int for a attribute of a class

In domain it is int

In the Oracle DB , the table is a NUMBER column (nullable). The is null in this column for a few records due to which i start getting the following exception

Quote:
Exception : org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of src.Person.setLastUpdatedUserId


For date or string type of attributes (fields) even if data is null i do not get exception.

Can any body please give me a workaround so that the field in the DB remains nullable and at the same time i would be able to retrieve and save the data pertaining to the entity.


It is an immediate need. Please help.

Regards
Ahmad[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 9:45 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Primitives (int) can not be null. Use java.lang.Integer which can be null.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 10:07 am 
Newbie

Joined: Sat Dec 24, 2005 8:39 am
Posts: 15
Thanks Jamie...

Regards
Ahmad


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.