openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <michael.d.d...@gmail.com>
Subject Re: How to change default Db type
Date Sun, 09 Aug 2009 18:08:41 GMT
Hi Chris,

Have you tried using the @Column annotation?

@Column(columnDefinition="DOUBLE UNSIGNED . . .")
private Double myDouble;

David's example will also work for the Oracle dictionary, but there isn't a
convenient way to get this behavior automatically. You might be able to get
it to work by specifying the typeModifierSet. I'm not sure how to specify a
set with our config options though it might take some experimentation.
Here's a starting point :

<property name="openjpa.jdbc.DBDictionary"
value="oracle(typeModifierSet={&qout;UNSIGNED&quot;})"/>

The typeModifer is only used if the sql type is sized so you'll need to
specify that in your annotations / orm.xml too..

Overall I'd recommend the columnDefinition route - it'll be portable for one
thing. Hope this helps,

-mike

On Sun, Aug 9, 2009 at 6:47 AM, David Beer <david.m.beer@googlemail.com>wrote:

> On Sun, 9 Aug 2009 20:32:02 +1000
> "C N Davies" <cnd@cndavies.com> wrote:
>
> > Hi,
> >
> >
> >
> > Following on my earlier issue with BigDecimal precision, I switched
> > to using doubles instead. This works fine except that OpenJPA is
> > creating DOUBLE columns as unsigned doubles while they should be
> > signed doubles.  I can't see anything in the docs that tells me how I
> > can force OpenJPA to create the required type.
> >
> >
> >
> > Did I miss something?
> >
> >
> >
> > Chris
> >
> >
> >
>
> Hi Chris
>
> I set the DB dictioanary and that helps me solve a problem I had with
> h2. There may be something similar for Oracle. The persistence.xml
> entry looks like this.
>
> <property name="openjpa.jdbc.DBDictionary"
>
> value="org.apache.openjpa.jdbc.sql.H2Dictionary(useGetObjectForBlobs=false)"/>
>
> --
> Best Regards
>
> David Beer
>
> http://www.thebeerfamily.com
>

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