Subject Re: [Firebird-Java] Simple typing question
Author Mark Rotteveel
On 11-7-2010 12:15, Yves Glodt wrote:
> Hi Mark,
>
> here the column definition:
>
> SQL> show table intervention_ligne;
> ...
> NO_INTERVENTION (TDOUBLENN) DOUBLE PRECISION Not Null
>
>
> The relevant part of the annotated class looks like this:
>
> @Id
> @Column(name = "NO_INTERVENTION", nullable = false)
> private Double noIntervention;
>
>
> The full stack trace:
>
> Caused by: org.firebirdsql.jdbc.field.TypeConvertionException: Error
> converting to int.
> at org.firebirdsql.jdbc.field.FBField.getInt(FBField.java:493)
> at
> org.firebirdsql.jdbc.AbstractResultSet.getInt(AbstractResultSet.java:753)
> at
> org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:275)
> at
> org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:275)
> at org.hibernate.type.IntegerType.get(IntegerType.java:51)

This seems to suggest that Hibernate thinks it should get an integer,
not a double. Are you sure the failure is at getting the value of this
column (and not another column)?

Have you configured Hibernate to use org.hibernate.dialect.FirebirdDialect?

I haven't used Hibernate in a while (and only then just for simple
hobby-projects). You might want to try to add a columnDefinition
parameter to the Column annotation (eg @Column(name = "NO_INTERVENTION",
nullable = false, columnDefinition = "DOUBLE PRECISION NOT NULL"). Maybe
that helps?


--
Mark Rotteveel