[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-490) Primitive type exception

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Thu Aug 17 00:48:18 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-490?page=comments#action_23957 ] 

Max Rydahl Andersen commented on HBX-490:
-----------------------------------------

eh yes, that is what the exception states: "Null value was assigned to a property of primitive type..." :)

but it has nothing to do with "default value isn't set", it *should* be set and thus you want it to be set to what the value is, namely a Long.

> Primitive type exception
> ------------------------
>
>          Key: HBX-490
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-490
>      Project: Hibernate Tools
>         Type: Bug

>     Versions: 3.1beta2
>  Environment: Hibernate 3.1rc2, Oracle 9
>     Reporter: George Lindholm
>     Priority: Minor
>      Fix For: 3.1beta2

>
>
> I want to model/POJO one table (out of a large schema). The table has a reference to another table
> that I'm not modeling:
>         <property name="lastUpdtBy" type="long">
>             <column name="LAST_UPDT_BY" precision="10" scale="0" />
>         </property>
> which hbm2java turns into:
>    private long lastUpdtBy;
>    public void setLastUpdtBy(long lastUpdtBy) {
> however when I do a find("from ncOrgUnit") I get:
>   org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of ca.ubc.nmc.contacts.db.NcOrgUnit.lastUpdtBy
> If I change the method signature to 
>    public void setLastUpdtBy(Long lastUpdtBy) {
> the exception goes away and things seem to work.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list