Cayenne
  1. Cayenne
  2. CAY-1535

Error in creating classes from a HSQLDB 2.0 database

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.1
    • Fix Version/s: None
    • Component/s: Modeler
    • Labels:
      None
    • Environment:
      Mac OS X 10.6.6 (10J567)
      MyEclipse Enterprise Workbench
      Version: 8.6.1
      Build id: 8.6.1-20101117

      Description

      I'm running the modeler in myEclipse, because I'm trying to make a model on a HSQLDB 2.0 server.
      To do that I run the modeler source code from the IDE in debug mode, with all library in distribution except for hsqldb, in the classpath I've putted hsqldb version 2.0.
      I get the error when i try to generate the java code for classes mapped on the db

      The error comes up at line 76 of org.apache.cayenne.access.types.BooleanType

      the offending statement: st.setObject(pos, val, type);

      The vaules:

      this BooleanType (id=143)
      st JDBCPreparedStatement (id=203)
      val Boolean (id=177)
      pos 1
      type 4
      precision -1

      The stack trace

      CayenneModeler Info
      Version: 3.0.1
      Build Date: Aug 25 2010 19:38:17
      Exception:
      =================================
      java.sql.SQLSyntaxErrorException: incompatible data type in conversion
      at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
      at org.hsqldb.jdbc.Util.throwError(Unknown Source)
      at org.hsqldb.jdbc.JDBCPreparedStatement.setParameter(Unknown Source)
      at org.hsqldb.jdbc.JDBCPreparedStatement.setObject(Unknown Source)
      at org.hsqldb.jdbc.JDBCPreparedStatement.setObject(Unknown Source)
      at org.apache.cayenne.access.types.BooleanType.setJdbcObject(BooleanType.java:76)
      at org.apache.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:542)
      at org.apache.cayenne.access.trans.InsertBatchQueryBuilder.bindParameters(InsertBatchQueryBuilder.java:61)
      at org.apache.cayenne.access.jdbc.BatchAction.runAsIndividualQueries(BatchAction.java:219)
      at org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:91)
      at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
      at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:269)
      at org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlushAction.java:226)
      at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:144)
      at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824)
      at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791)
      at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
      at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788)
      at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106)
      at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
      at org.apache.cayenne.pref.DomainPreference.getPreference(DomainPreference.java:107)
      at org.apache.cayenne.pref.Domain.getDetail(Domain.java:231)
      at org.apache.cayenne.modeler.ProjectController.getDataMapPreferences(ProjectController.java:376)
      at org.apache.cayenne.modeler.dialog.codegen.StandardModeController.createDefaults(StandardModeController.java:49)
      at org.apache.cayenne.modeler.dialog.codegen.GeneratorController.<init>(GeneratorController.java:69)
      at org.apache.cayenne.modeler.dialog.codegen.StandardModeController.<init>(StandardModeController.java:34)
      at org.apache.cayenne.modeler.dialog.codegen.GeneratorTabController.<init>(GeneratorTabController.java:54)
      at org.apache.cayenne.modeler.dialog.codegen.CodeGeneratorController.<init>(CodeGeneratorController.java:55)
      at org.apache.cayenne.modeler.action.GenerateCodeAction.performAction(GenerateCodeAction.java:47)
      at org.apache.cayenne.modeler.util.CayenneAction.actionPerformed(CayenneAction.java:163)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
      at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
      at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:137)
      at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
      at java.awt.Component.processMouseEvent(Component.java:6352)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6117)
      at java.awt.Container.processEvent(Container.java:2085)
      at java.awt.Component.dispatchEventImpl(Component.java:4714)
      at java.awt.Container.dispatchEventImpl(Container.java:2143)
      at java.awt.Component.dispatchEvent(Component.java:4544)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
      at java.awt.Container.dispatchEventImpl(Container.java:2129)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4544)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
      Caused by: org.hsqldb.HsqlException: incompatible data type in conversion
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.types.NumberType.convertToDefaultType(Unknown Source)
      ... 57 more
      Caused by:
      org.hsqldb.HsqlException: incompatible data type in conversion
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.error.Error.error(Unknown Source)
      at org.hsqldb.types.NumberType.convertToDefaultType(Unknown Source)
      at org.hsqldb.jdbc.JDBCPreparedStatement.setParameter(Unknown Source)
      at org.hsqldb.jdbc.JDBCPreparedStatement.setObject(Unknown Source)
      at org.hsqldb.jdbc.JDBCPreparedStatement.setObject(Unknown Source)
      at org.apache.cayenne.access.types.BooleanType.setJdbcObject(BooleanType.java:76)
      at org.apache.cayenne.dba.JdbcAdapter.bindParameter(JdbcAdapter.java:542)
      at org.apache.cayenne.access.trans.InsertBatchQueryBuilder.bindParameters(InsertBatchQueryBuilder.java:61)
      at org.apache.cayenne.access.jdbc.BatchAction.runAsIndividualQueries(BatchAction.java:219)
      at org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:91)
      at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
      at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:269)
      at org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlushAction.java:226)
      at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:144)
      at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824)
      at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791)
      at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850)
      at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788)
      at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106)
      at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
      at org.apache.cayenne.pref.DomainPreference.getPreference(DomainPreference.java:107)
      at org.apache.cayenne.pref.Domain.getDetail(Domain.java:231)
      at org.apache.cayenne.modeler.ProjectController.getDataMapPreferences(ProjectController.java:376)
      at org.apache.cayenne.modeler.dialog.codegen.StandardModeController.createDefaults(StandardModeController.java:49)
      at org.apache.cayenne.modeler.dialog.codegen.GeneratorController.<init>(GeneratorController.java:69)
      at org.apache.cayenne.modeler.dialog.codegen.StandardModeController.<init>(StandardModeController.java:34)
      at org.apache.cayenne.modeler.dialog.codegen.GeneratorTabController.<init>(GeneratorTabController.java:54)
      at org.apache.cayenne.modeler.dialog.codegen.CodeGeneratorController.<init>(CodeGeneratorController.java:55)
      at org.apache.cayenne.modeler.action.GenerateCodeAction.performAction(GenerateCodeAction.java:47)
      at org.apache.cayenne.modeler.util.CayenneAction.actionPerformed(CayenneAction.java:163)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
      at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
      at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:137)
      at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
      at java.awt.Component.processMouseEvent(Component.java:6352)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6117)
      at java.awt.Container.processEvent(Container.java:2085)
      at java.awt.Component.dispatchEventImpl(Component.java:4714)
      at java.awt.Container.dispatchEventImpl(Container.java:2143)
      at java.awt.Component.dispatchEvent(Component.java:4544)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
      at java.awt.Container.dispatchEventImpl(Container.java:2129)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4544)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

        Activity

        Hide
        Andrus Adamchik added a comment -

        Unfortunately I suspect there's no fix for this situation in 3.0.x. CayenneModeler 3.1 no longer uses or bundles HSQLDB due to prefrences mechanism refactoring, so the problem is solved on the current dev brunch. For 3.0 you will have to use regular modeler (or even better - Ant or Maven script) to generate classes.

        Show
        Andrus Adamchik added a comment - Unfortunately I suspect there's no fix for this situation in 3.0.x. CayenneModeler 3.1 no longer uses or bundles HSQLDB due to prefrences mechanism refactoring, so the problem is solved on the current dev brunch. For 3.0 you will have to use regular modeler (or even better - Ant or Maven script) to generate classes.

          People

          • Assignee:
            Unassigned
            Reporter:
            Lorenzo Mengoni
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development