-->
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.  [ 1 post ] 
Author Message
 Post subject: Floats always retreived as nulls.
PostPosted: Tue Jul 11, 2006 6:04 pm 
Newbie

Joined: Fri May 20, 2005 12:02 pm
Posts: 10
Hibernate version:
3.1.3

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

<hibernate-mapping default-access="field" default-lazy="true"
package="a.b.c">
<class name="MyAbstractTemplateClass" abstract="true">
<id name = "id" column="id" type="string" length="45" />
<property name="lastModified"
column="last_modified"
type="timestamp"
not-null="true" />
<union-subclass name="MyConcreteClass"
extends="MyAbstractTemplateClass"
table="my_table">
<property name="aperture" column="aperture" type="string" not-null="false"/>
<property name="azimuth" column="azimuth" type="float" not-null="false"/>
<property name="backend" column="backend" type="string" not-null="false"/>
<property name="backtype" column="backtype" type="string" not-null="false"/>
<property name="bii" column="bii" type="float" not-null="false"/>
</union-subclass>
</class>
</hibernate-mapping>

Name and version of the database you are using:
Sybase ASE 12.5

My unit tests, which do nothing more than call getCurrentSession().save(MyConcreteClass) within a transaction, store the data fine, but upon retrieving it, only those fields with a datatype of float (java.lang.Float in MyConcreteClass) come back null when I load the instance of MyConcreteClass. If I look in the database, it's stored fine, and if I rerun the test without purging the data, it runs fine and the Floats have data. Has anyone encountered this weirdness before? Are Floats handled differently?

My Sybase defines the columns just as floats, without any length specified and they're all nullable.

Many thanks,
Dustin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.