openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Håkon Sagehaug <hakon.sageh...@uni.no>
Subject Saving a double in prosgres
Date Thu, 10 Jun 2010 10:59:05 GMT
Hi all,

I've got a persitent collection in a entity looking like this

@PersistentCollection
    double[] doubleValues;

But when  I store the values the, it's rounded up. So if I want to store the
value 2.1999999999999993 in the database it's stored as 2.2. The driver I 'm
using is postgresql-8.3-603.jdbc3.jar. Should I use another type in the
entity or is there another solution. I guess it's this issue [1], I'm
facing. I found that you could set column property like this

 @Column(columnDefinition="DOUBLEUNSIGNED",precision=10,scale=6,nullable=false)

But hwo can I set hat on a persitent collection?

cheers, Håkon

[1]
http://openjpa.apache.org/builds/latest/docs/manual/dbsupport_postgresql.html#dbsupport_postgresql_issues

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message