GanttChartTemplate: VirtualTable <-> MySQL DB communication problems

Description

Initial behaviour:
--------------------------------------------------------------
I create a new project.
First of all I create a new Window. Let's call this MainWindow. In the MainWindow I place the XdevGanttChartTemplate. I perform a right click on it and let me create the needed virtual tables.

Two VTs are now in my project management: GanttVt and GanttRelationDataVt.
GanttVt.java -> The field "Table" is empty.
GanttRelationDataVt.java -> The field "Table" contains "GanttRelationDataVt"

Now I add a new MySQL DataSource and enter my connection information. I do an exact mapping of my VTs in my SQL Statements (See attached SQL-Files) and execute them. Now my database tables looks exact like the generated VTs.

Now I add another window called "AddData" and place a XdevTable onto it. I drag and drop the VT GanttVt two times on my window. The first time onto the table, the second time to generate a form (Note: I uncheckd 'Search for table').
Afterwards I link the form and the table via the palette.

Now I start the application.
--------------------------------------------------------------

Real behaviour:
--------------------------------------------------------------
The first exception is the following:

exceptionStartApplication.txt

Jun 27, 2013 1:18:22 PM xdev.util.logging.XdevLoggerImpl error
SEVERE:
xdev.db.DBException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
.description,
.start,
.end,
.root,
.percentage

FROM' at line 2
at xdev.db.jdbc.JDBCConnection.queryJDBCImpl(JDBCConnection.java:278)
at xdev.db.jdbc.JDBCConnection.queryJDBC(JDBCConnection.java:231)
at xdev.db.jdbc.JDBCConnection.queryJDBC(JDBCConnection.java:220)
at xdev.db.jdbc.JDBCConnection.query(JDBCConnection.java:159)
at xdev.db.jdbc.JDBCConnection.query(JDBCConnection.java:141)
at xdev.db.jdbc.JDBCConnection.query(JDBCConnection.java:1)
at xdev.vt.VirtualTable.queryAndFill(VirtualTable.java:8020)
at xdev.vt.VirtualTable.queryAndFill(VirtualTable.java:8010)
at xdev.vt.VirtualTable.queryAndFill(VirtualTable.java:7990)
at xdev.ui.TableSupport.setModel(TableSupport.java:343)
at xdev.ui.TableSupport.setModel(TableSupport.java:260)
at xdev.ui.XdevTable.setModel(XdevTable.java:276)
at Fenster.AddData.<init>(AddData.java:150)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:374)
at java.lang.Class.newInstance(Class.java:327)
at xdev.Application.startApplicationImpl(Application.java:542)
at xdev.Application.startApplication(Application.java:504)
at xdev.Application.main(Application.java:294)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
.description,
.start,
.end,
.root,
.percentage

FROM' at line 2
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2677)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2627)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1556)
at xdev.db.jdbc.JDBCConnection.queryJDBCImpl(JDBCConnection.java:267)
... 21 more

Ignoring this exception I enter some normal data in my form. I left the "root" field empty. After I pressed save the following exception is shown:

exceptionSavaAction.txt"

xdev.db.DBException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(description, start, end, root, percentage)
VALUES
('MeineBeschreibung', '2013-0' at line 2
at xdev.db.jdbc.JDBCConnection.writeImpl(JDBCConnection.java:521)
at xdev.db.jdbc.JDBCConnection.write(JDBCConnection.java:445)
at xdev.db.jdbc.JDBCConnection.write(JDBCConnection.java:425)
at xdev.vt.VirtualTable.writeDB(VirtualTable.java:5463)
at xdev.vt.VirtualTable.addRow(VirtualTable.java:4630)
at xdev.vt.VirtualTable.addRow(VirtualTable.java:4526)
at xdev.vt.VirtualTable.addRow(VirtualTable.java:4447)
at xdev.vt.VirtualTable.addRow(VirtualTable.java:4415)
at xdev.ui.FormularSupport.save(FormularSupport.java:401)
at xdev.ui.XdevFormular.save(XdevFormular.java:1147)
at xdev.ui.XdevFormular.save(XdevFormular.java:1137)
at Fenster.AddData.cmdSave_actionPerformed(AddData.java:53)
at Fenster.AddData$4.actionPerformed(AddData.java:219)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:702)
at java.awt.EventQueue$4.run(EventQueue.java:700)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(description, start, end, root, percentage)
VALUES
('MeineBeschreibung', '2013-0' at line 2
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4096)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4028)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2683)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2144)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2444)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2362)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2347)
at xdev.db.jdbc.JDBCConnection.writeImpl(JDBCConnection.java:493)
... 48 more
Jun 27, 2013 1:19:57 PM xdev.util.logging.XdevLoggerImpl error
SEVERE:
java.lang.IllegalArgumentException: Illegal date style -1
at java.text.DateFormat.get(DateFormat.java:750)
at java.text.DateFormat.getDateInstance(DateFormat.java:508)
at xdev.ui.text.TextFormat.createFormat(TextFormat.java:283)
at xdev.ui.text.TextFormat.getFormat(TextFormat.java:419)
at xdev.ui.text.TextFormat.format(TextFormat.java:617)
at xdev.ui.table.DateRenderer.getRendererComponent(DateRenderer.java:51)
at xdev.ui.table.XdevTableRenderer.getTableCellRendererComponent(XdevTableRenderer.java:159)
at javax.swing.JTable.prepareRenderer(JTable.java:5731)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2114)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2016)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1812)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1512)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1443)
at javax.swing.RepaintManager.paint(RepaintManager.java:1236)
at javax.swing.JComponent._paintImmediately(JComponent.java:5169)
at javax.swing.JComponent.paintImmediately(JComponent.java:4980)
at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
at javax.swing.RepaintManager$3.run(RepaintManager.java:784)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:784)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:757)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:706)
at javax.swing.RepaintManager.access$1000(RepaintManager.java:62)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1651)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Jun 27, 2013 1:19:57 PM xdev.util.logging.XdevLoggerImpl error
SEVERE:
java.lang.IllegalArgumentException: Illegal date style -1
at java.text.DateFormat.get(DateFormat.java:750)
at java.text.DateFormat.getDateInstance(DateFormat.java:508)
at xdev.ui.text.TextFormat.createFormat(TextFormat.java:283)
at xdev.ui.text.TextFormat.getFormat(TextFormat.java:419)
at xdev.ui.text.TextFormat.format(TextFormat.java:617)
at xdev.ui.table.DateRenderer.getRendererComponent(DateRenderer.java:51)
at xdev.ui.table.XdevTableRenderer.getTableCellRendererComponent(XdevTableRenderer.java:159)
at javax.swing.JTable.prepareRenderer(JTable.java:5731)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2114)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2016)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1812)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1512)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1443)
at javax.swing.RepaintManager.paint(RepaintManager.java:1236)
at javax.swing.JComponent._paintImmediately(JComponent.java:5169)
at javax.swing.JComponent.paintImmediately(JComponent.java:4980)
at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
at javax.swing.RepaintManager$3.run(RepaintManager.java:784)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:784)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:757)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:706)
at javax.swing.RepaintManager.access$1000(RepaintManager.java:62)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1651)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

--------------------------------------------------------------

Expected behaviour:
--------------------------------------------------------------
Everything should work fine.
--------------------------------------------------------------

Comment:
--------------------------------------------------------------
Everything needed is attached.
--------------------------------------------------------------

Environment

XDEV 4 beta 2 - 20130613-1000
XDEV Platform 2.4
Java(TM) SE Runtime Environment 1.7.0_21-b11
Java HotSpot(TM) 64-Bit Server VM (mixed mode)
Java Platform API Specification 1.7, Oracle Corporation
Windows 7 (6.1, amd64)
amd64
Deutschland, Deutsch, Cp1252
XAPI 4
Preview server stopped
Embedded database (H2) running at port 5435
Embedded database (SQLite) initialized

Activity

Show:
Sebastian
September 9, 2013, 12:20 PM

The problem can not be reproduced with the current XDEV 4 version. I've used a MySQL 5.5.16 database and the SQL files from JS.

JW
July 17, 2013, 2:11 PM

See linked Issue for further investigation.

A
June 27, 2013, 1:15 PM

Tested it with the H2.

SQL Script to create tables:

DROP TABLE IF EXISTS GanttRelationData;
DROP TABLE IF EXISTS Gantt;

CREATE TABLE Gantt
(
id INT UNSIGNED NULL DEFAULT NULL AUTO_INCREMENT PRIMARY KEY,
description VARCHAR(250) NOT NULL,
start DATE NULL DEFAULT NULL,
end DATE NULL DEFAULT NULL,
root INT UNSIGNED NULL DEFAULT NULL,
percentage DOUBLE NULL DEFAULT NULL
);

CREATE TABLE GanttRelationData
(
id INT UNSIGNED NULL DEFAULT NULL AUTO_INCREMENT PRIMARY KEY,
relation_id INT UNSIGNED NULL DEFAULT NULL,
entry_id INT UNSIGNED NULL DEFAULT NULL,
relationRoot_id INT UNSIGNED NULL DEFAULT NULL
);

Then import of the virtual tables.
Everything works fine!

Fixed

Assignee

JW

Reporter

A