Subject Re: [Firebird-Java] Simple typing question
Author Yves Glodt
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:

org.hibernate.exception.SQLGrammarException: could not load an entity:
[lu.sitasoftware.azur.domain.InterventionLigne#component[noLigne,noIntervention,noDossier]{noLigne=1,
noDossier=690, noIntervention=1234.0}]
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1895)
at
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
at
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
at
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3072)
at
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434)
at
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415)
at
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
at
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:121)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:863)
at
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:95)
at
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:140)
at
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
at
lu.sitasoftware.azur.domain.InterventionLigne_$$_javassist_1.getNoIntervention(InterventionLigne_$$_javassist_1.java)
at lu.sitasoftware.web.servlets.Test.doGet(Test.java:33)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
at
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
at
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
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)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
at
org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2124)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
at org.hibernate.loader.Loader.getRow(Loader.java:1230)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
at org.hibernate.loader.Loader.doQuery(Loader.java:724)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1881)
... 34 more




Note: when I change the type in the class from Double to Integer, it still
fails, with the same execption, look here:

org.hibernate.exception.SQLGrammarException: could not load an entity:
[lu.sitasoftware.azur.domain.InterventionLigne#component[noLigne,noIntervention,noDossier]{noLigne=1,
noDossier=690, noIntervention=1234}]

org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.loader.Loader.loadEntity(Loader.java:1895)

org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3072)

org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434)
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)

org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:121)
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:863)

org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:95)
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:140)
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)

lu.sitasoftware.azur.domain.InterventionLigne_$$_javassist_1.getNoIntervention(InterventionLigne_$$_javassist_1.java)
lu.sitasoftware.web.servlets.Test.doGet(Test.java:33)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)

org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)

*root cause*

org.firebirdsql.jdbc.field.TypeConvertionException: Error converting to int.

org.firebirdsql.jdbc.field.FBField.getInt(FBField.java:493)
org.firebirdsql.jdbc.AbstractResultSet.getInt(AbstractResultSet.java:753)
org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:275)

org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:275)
org.hibernate.type.IntegerType.get(IntegerType.java:51)
org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184)
org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173)

org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2124)
org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)

org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
org.hibernate.loader.Loader.getRow(Loader.java:1230)
org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
org.hibernate.loader.Loader.doQuery(Loader.java:724)

org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.loadEntity(Loader.java:1881)
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)

org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3072)
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434)

org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:121)

org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:863)
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:95)

org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:140)
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
lu.sitasoftware.azur.domain.InterventionLigne_$$_javassist_1.getNoIntervention(InterventionLigne_$$_javassist_1.java)

lu.sitasoftware.web.servlets.Test.doGet(Test.java:33)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)

org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)



Thanks in advance,
Yves



On 11 July 2010 08:44, Mark Rotteveel <Avalanche1979@...> wrote:

> Could you please post the full stacktrace, and more details on your table
> structure and the class (and the hibernate mapping if not using
> annotations)?
>
> Mark
>
> > Hi,
> >
> > I have a column in a table defined as "DOUBLE PRECISION", in a firebird
> > 1.5
> > database (probably with dialect 1).
> >
> > Using hibernate, what would be the correct type for such a column? I go
> > for
> > "Double" in java, but am not sure since my app fails
> > with;
> >
> > "org.hibernate.exception.SQLGrammarException: could not load an entity:"
> > and
> > "org.firebirdsql.jdbc.field.TypeConvertionException: Error converting to
> > int."
> >
> >
> > Best regards,
> > Yves
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>


[Non-text portions of this message have been removed]