This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

ModelException Nicht existierende Spalte existiert nicht

Allgemeine Fragen zur Entwicklung von und mit JVx.

ModelException Nicht existierende Spalte existiert nicht

Postby alladinbp » Fri Oct 28, 2011 4:17 pm

Hallo,

vorweg: Ich hab gerade auf Beta 5 geupdated, das Problem besteht aber immer noch. Und zwar bekomme ich seit ich LinkReferences benutze ModelExceptions. Das Programm funktioniert normal weiter.
An einem Beispiel:

Ich verbinde die Kunden View mit einer Vermittler Tabelle. Beim Kunden-Formular wird mir dadurch eine Combobox angelegt usw. Das DataBook der Kunden View ist "rdbCustomerData", das von den Agenten ist "rdbAgentData". Die Kunden View hat den Foreign-Key "agent_id" der auf die id der Agent-Tabelle zeigt. In "agent" steht dann der Initialwert. Ausschnitt der Kunden View:

Code: Select all
CREATE OR REPLACE VIEW customer_data (
...
agent_id,
agent,
...
) AS SELECT
...
customer.agent_id,
(select name from agent where customer.agent_id = id) agent,
...
FROM
customer
...


Die ReferenceDefinition sieht folgendermaßen aus:

Code: Select all
ReferenceDefinition referenceDef = new ReferenceDefinition();
      
referenceDef.setReferencedDataBook(rdbAgentData);
referenceDef.setColumnNames(new String[] {"AGENT_ID", "AGENT"});
referenceDef.setReferencedColumnNames(new String[] {"ID", "NAME"});
      
UILinkedCellEditor linkedCellEditor = new UILinkedCellEditor();
linkedCellEditor.setLinkReference(referenceDef);
linkedCellEditor.setTableHeaderVisible(false);
      
rdbCustomerData.getRowDefinition().getColumnDefinition("AGENT").getDataType().setCellEditor(linkedCellEditor);


Wie gesagt funktioniert es so auch. Laden und Speichern ist alles kein Problem.
Trotzdem wird folgende Exception geworfen:

Code: Select all
28.10.2011 15:34:52 [ FINE        ] com.sibvisions.rad.persist.jdbc.DBStorage getMetaData (Line: -1)
                                    javax.rad.model.ModelException: Column 'AGENT_NAME' doesn't exists in MetaData!
                                       at com.sibvisions.rad.persist.jdbc.ServerMetaData.getServerColumnMetaData(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.getMetaData(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.openInternal(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.open(Unknown Source)
                                       at at.alladin.vms.server.CustomerManagement.getCustomerData(CustomerManagement.java:19)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at com.sibvisions.rad.server.GenericBean.get(Unknown Source)
                                       at com.sibvisions.rad.server.GenericBean.get(Unknown Source)
                                       at at.alladin.vms.server.CustomerManagement.getCustomerData(CustomerManagement.java:8)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.rad.server.DefaultObjectProvider.getObject(Unknown Source)
                                       at com.sibvisions.rad.server.DefaultObjectProvider.invoke(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.executeWithSessionContext(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.executeIntern(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.execute(Unknown Source)
                                       at com.sibvisions.rad.server.Server.executeIntern(Unknown Source)
                                       at com.sibvisions.rad.server.Server.execute(Unknown Source)
                                       at com.sibvisions.rad.server.DirectServerConnection.call(Unknown Source)
                                       at javax.rad.remote.AbstractConnection.call(Unknown Source)
                                       at com.sibvisions.rad.model.remote.RemoteDataBook.initServerMetaData(Unknown Source)
                                       at com.sibvisions.rad.model.remote.RemoteDataBook.open(Unknown Source)
                                       at at.alladin.vms.client.panels.CustomerManagementPanel.<init>(CustomerManagementPanel.java:82)
                                       at at.alladin.vms.client.VMSApplication.afterLogin(VMSApplication.java:160)
                                       at com.sibvisions.rad.application.Application.doLogin(Unknown Source)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at javax.rad.util.EventHandler$ListenerHandler.dispatchEvent(Unknown Source)
                                       at javax.rad.util.EventHandler.dispatchEvent(Unknown Source)
                                       at javax.rad.util.RuntimeEventHandler.dispatchEvent(Unknown Source)
                                       at com.sibvisions.rad.ui.swing.impl.component.SwingAbstractButton.actionPerformed(Unknown Source)
                                       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                                       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                                       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                                       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                                       at javax.swing.AbstractButton.doClick(Unknown Source)
                                       at javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown Source)
                                       at javax.swing.SwingUtilities.notifyAction(Unknown Source)
                                       at javax.swing.JComponent.processKeyBinding(Unknown Source)
                                       at javax.swing.KeyboardManager.fireBinding(Unknown Source)
                                       at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
                                       at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
                                       at javax.swing.JComponent.processKeyBindings(Unknown Source)
                                       at javax.swing.JComponent.processKeyEvent(Unknown Source)
                                       at java.awt.Component.processEvent(Unknown Source)
                                       at java.awt.Container.processEvent(Unknown Source)
                                       at java.awt.Component.dispatchEventImpl(Unknown Source)
                                       at java.awt.Container.dispatchEventImpl(Unknown Source)
                                       at java.awt.Component.dispatchEvent(Unknown Source)
                                       at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
                                       at java.awt.Component.dispatchEventImpl(Unknown Source)
                                       at java.awt.Container.dispatchEventImpl(Unknown Source)
                                       at java.awt.Window.dispatchEventImpl(Unknown Source)
                                       at java.awt.Component.dispatchEvent(Unknown Source)
                                       at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
                                       at java.awt.EventQueue.access$000(Unknown Source)
                                       at java.awt.EventQueue$1.run(Unknown Source)
                                       at java.awt.EventQueue$1.run(Unknown Source)
                                       at java.security.AccessController.doPrivileged(Native Method)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.awt.EventQueue$2.run(Unknown Source)
                                       at java.awt.EventQueue$2.run(Unknown Source)
                                       at java.security.AccessController.doPrivileged(Native Method)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.awt.EventQueue.dispatchEvent(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                       at java.awt.EventDispatchThread.run(Unknown Source)


Es gibt nirgends eine Spalte "agent_name". Das selbe passiert auch bei einer LinkRef auf zwei andere Tabellen. Besonders eindrucksvoll ist wie JVx vom Feld "type" auf "type_type" kommt, oder von "account_manager" auf "account_manager_current_user".

Code: Select all
com.sibvisions.rad.persist.jdbc.DBStorage getMetaData (Line: -1)
                                    javax.rad.model.ModelException: Column 'TYPE_TYPE' doesn't exists in MetaData!
                                       at com.sibvisions.rad.persist.jdbc.ServerMetaData.getServerColumnMetaData(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.getMetaData(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.openInternal(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.open(Unknown Source)
                                       at at.alladin.vms.server.CustomerManagement.getCustomerData(CustomerManagement.java:19)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at com.sibvisions.rad.server.GenericBean.get(Unknown Source)
                                       at com.sibvisions.rad.server.GenericBean.get(Unknown Source)
                                       at at.alladin.vms.server.CustomerManagement.getCustomerData(CustomerManagement.java:8)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.rad.server.DefaultObjectProvider.getObject(Unknown Source)
                                       at com.sibvisions.rad.server.DefaultObjectProvider.invoke(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.executeWithSessionContext(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.executeIntern(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.execute(Unknown Source)
                                       at com.sibvisions.rad.server.Server.executeIntern(Unknown Source)
                                       at com.sibvisions.rad.server.Server.execute(Unknown Source)
                                       at com.sibvisions.rad.server.DirectServerConnection.call(Unknown Source)
                                       at javax.rad.remote.AbstractConnection.call(Unknown Source)
                                       at com.sibvisions.rad.model.remote.RemoteDataBook.initServerMetaData(Unknown Source)
                                       at com.sibvisions.rad.model.remote.RemoteDataBook.open(Unknown Source)
                                       at at.alladin.vms.client.panels.CustomerManagementPanel.<init>(CustomerManagementPanel.java:82)
                                       at at.alladin.vms.client.VMSApplication.afterLogin(VMSApplication.java:160)
                                       at com.sibvisions.rad.application.Application.doLogin(Unknown Source)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at javax.rad.util.EventHandler$ListenerHandler.dispatchEvent(Unknown Source)
                                       at javax.rad.util.EventHandler.dispatchEvent(Unknown Source)
                                       at javax.rad.util.RuntimeEventHandler.dispatchEvent(Unknown Source)
                                       at com.sibvisions.rad.ui.swing.impl.component.SwingAbstractButton.actionPerformed(Unknown Source)
                                       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                                       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                                       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                                       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                                       at javax.swing.AbstractButton.doClick(Unknown Source)
                                       at javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown Source)
                                       at javax.swing.SwingUtilities.notifyAction(Unknown Source)
                                       at javax.swing.JComponent.processKeyBinding(Unknown Source)
                                       at javax.swing.KeyboardManager.fireBinding(Unknown Source)
                                       at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
                                       at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
                                       at javax.swing.JComponent.processKeyBindings(Unknown Source)
                                       at javax.swing.JComponent.processKeyEvent(Unknown Source)
                                       at java.awt.Component.processEvent(Unknown Source)
                                       at java.awt.Container.processEvent(Unknown Source)
                                       at java.awt.Component.dispatchEventImpl(Unknown Source)
                                       at java.awt.Container.dispatchEventImpl(Unknown Source)
                                       at java.awt.Component.dispatchEvent(Unknown Source)
                                       at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
                                       at java.awt.Component.dispatchEventImpl(Unknown Source)
                                       at java.awt.Container.dispatchEventImpl(Unknown Source)
                                       at java.awt.Window.dispatchEventImpl(Unknown Source)
                                       at java.awt.Component.dispatchEvent(Unknown Source)
                                       at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
                                       at java.awt.EventQueue.access$000(Unknown Source)
                                       at java.awt.EventQueue$1.run(Unknown Source)
                                       at java.awt.EventQueue$1.run(Unknown Source)
                                       at java.security.AccessController.doPrivileged(Native Method)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.awt.EventQueue$2.run(Unknown Source)
                                       at java.awt.EventQueue$2.run(Unknown Source)
                                       at java.security.AccessController.doPrivileged(Native Method)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.awt.EventQueue.dispatchEvent(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                       at java.awt.EventDispatchThread.run(Unknown Source)


Code: Select all

28.10.2011 15:34:52 [ FINE        ] com.sibvisions.rad.persist.jdbc.DBStorage getMetaData (Line: -1)
                                    javax.rad.model.ModelException: Column 'ACCOUNT_MANAGER_CURRENT_USER' doesn't exists in MetaData!
                                       at com.sibvisions.rad.persist.jdbc.ServerMetaData.getServerColumnMetaData(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.getMetaData(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.openInternal(Unknown Source)
                                       at com.sibvisions.rad.persist.jdbc.DBStorage.open(Unknown Source)
                                       at at.alladin.vms.server.CustomerManagement.getCustomerData(CustomerManagement.java:19)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at com.sibvisions.rad.server.GenericBean.get(Unknown Source)
                                       at com.sibvisions.rad.server.GenericBean.get(Unknown Source)
                                       at at.alladin.vms.server.CustomerManagement.getCustomerData(CustomerManagement.java:8)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.util.Reflective.call(Unknown Source)
                                       at com.sibvisions.rad.server.DefaultObjectProvider.getObject(Unknown Source)
                                       at com.sibvisions.rad.server.DefaultObjectProvider.invoke(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.executeWithSessionContext(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.executeIntern(Unknown Source)
                                       at com.sibvisions.rad.server.AbstractSession.execute(Unknown Source)
                                       at com.sibvisions.rad.server.Server.executeIntern(Unknown Source)
                                       at com.sibvisions.rad.server.Server.execute(Unknown Source)
                                       at com.sibvisions.rad.server.DirectServerConnection.call(Unknown Source)
                                       at javax.rad.remote.AbstractConnection.call(Unknown Source)
                                       at com.sibvisions.rad.model.remote.RemoteDataBook.initServerMetaData(Unknown Source)
                                       at com.sibvisions.rad.model.remote.RemoteDataBook.open(Unknown Source)
                                       at at.alladin.vms.client.panels.CustomerManagementPanel.<init>(CustomerManagementPanel.java:82)
                                       at at.alladin.vms.client.VMSApplication.afterLogin(VMSApplication.java:160)
                                       at com.sibvisions.rad.application.Application.doLogin(Unknown Source)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                       at java.lang.reflect.Method.invoke(Unknown Source)
                                       at javax.rad.util.EventHandler$ListenerHandler.dispatchEvent(Unknown Source)
                                       at javax.rad.util.EventHandler.dispatchEvent(Unknown Source)
                                       at javax.rad.util.RuntimeEventHandler.dispatchEvent(Unknown Source)
                                       at com.sibvisions.rad.ui.swing.impl.component.SwingAbstractButton.actionPerformed(Unknown Source)
                                       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                                       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                                       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                                       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                                       at javax.swing.AbstractButton.doClick(Unknown Source)
                                       at javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown Source)
                                       at javax.swing.SwingUtilities.notifyAction(Unknown Source)
                                       at javax.swing.JComponent.processKeyBinding(Unknown Source)
                                       at javax.swing.KeyboardManager.fireBinding(Unknown Source)
                                       at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
                                       at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
                                       at javax.swing.JComponent.processKeyBindings(Unknown Source)
                                       at javax.swing.JComponent.processKeyEvent(Unknown Source)
                                       at java.awt.Component.processEvent(Unknown Source)
                                       at java.awt.Container.processEvent(Unknown Source)
                                       at java.awt.Component.dispatchEventImpl(Unknown Source)
                                       at java.awt.Container.dispatchEventImpl(Unknown Source)
                                       at java.awt.Component.dispatchEvent(Unknown Source)
                                       at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
                                       at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
                                       at java.awt.Component.dispatchEventImpl(Unknown Source)
                                       at java.awt.Container.dispatchEventImpl(Unknown Source)
                                       at java.awt.Window.dispatchEventImpl(Unknown Source)
                                       at java.awt.Component.dispatchEvent(Unknown Source)
                                       at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
                                       at java.awt.EventQueue.access$000(Unknown Source)
                                       at java.awt.EventQueue$1.run(Unknown Source)
                                       at java.awt.EventQueue$1.run(Unknown Source)
                                       at java.security.AccessController.doPrivileged(Native Method)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.awt.EventQueue$2.run(Unknown Source)
                                       at java.awt.EventQueue$2.run(Unknown Source)
                                       at java.security.AccessController.doPrivileged(Native Method)
                                       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
                                       at java.awt.EventQueue.dispatchEvent(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                                       at java.awt.EventDispatchThread.run(Unknown Source)


JVx hat somit recht, diese Spalte gibt es nicht. Aber warum kommt dieser Fehler? Mache ich etwas in der Implementierung falsch oder könnte das ein Bug sein?

mfg
Benjamin
alladinbp
 
Posts: 39
Joined: Tue Oct 11, 2011 2:27 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby Support@SIB » Fri Oct 28, 2011 4:22 pm

Welche Datenbank verwenden Sie?
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby alladinbp » Fri Oct 28, 2011 4:28 pm

Oh eines der wichtigsten Dinge vergessen. Im Moment ist es PostgreSQL 8.4 mit dem postgresql-8.4-703.jdbc4 Connector.
alladinbp
 
Posts: 39
Joined: Tue Oct 11, 2011 2:27 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby Support@SIB » Fri Oct 28, 2011 4:42 pm

OK.

Die Auswahllisten werden von JVx aufgrund des Datenmodells (FKs) automatisch ermittelt, sofern möglich. Die Namen werden aufgrund Ihrer FKs definiert und im Prinzip sollte dabei kein Problem sein.

Werden zusätzliche Auswahllisten bei Ihnen angezeigt?
Wie wurde die DBStorage definiert?
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby mhandsteiner » Fri Oct 28, 2011 6:16 pm

Die angezeigt Fehlermeldung ist eine Debug Meldung der DBStorage, die nur angezeigt wird, wenn das Debug-Log eingeschalten wird.

Hintergrund der Meldung:

Die DBStorage hat einen Automatismus, der auch bei Verwendung von VIEWS automatisch die ReferenceDefinitions erkennt, und in Folge am Client automatisch einen UILinkedCellEditor erzeugt.
Die Debug Meldung zeigt einem, wie man die Columns benennen muss, damit der Automatismus funktioniert.

Dieser Automatismus setzt eine gewisse Namenskonvention voraus:
Bsp:

Referenzierte Tabelle: agent
Columns in der Tabelle: id, name

Dann muss die View customer_data folgende columns haben: ..., agent_id, agent_name, ....

Allgemein:
<prefix>_id
<prefix>_<column name of referenced table>

Die Namenskonvention ist so gewählt, damit man keinen konflikt mit gleichen namen erhält. (Bsp: agent1_id, agent1_name, agent2_id, agent2_name).

Entspricht die View dieser Namenskonvention, brauchen Sie im Client Code weder das RemoteDataBook rdbAgentData anlegen, noch die ReferenceDefinition oder den UILinkedCellEditor.
Es wird am Server automatisch eine implizite DBStorage angelegt. (die man am Server auch von der CustomerData Storage mit getSubStorages() erhält).
Es wird am Client automatisch ein implizites RemoteDataBook angelegt. (das man am Client auch von der RemoteDataSource erhält).
Es wird am Client automatisch ein UILinkedCellEditor angelegt, und als CellEditor auf die entsprechende Column gesetzt. (den man am Client auch mit getRowDefinition().getColumnDefinition("...").getDataType().getCellEditor() erhält)
mhandsteiner
 
Posts: 15
Joined: Mon Sep 28, 2009 2:17 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby alladinbp » Thu Nov 03, 2011 6:28 pm

Danke für die Antwort.

Habe die AutoLinkReference jetzt abgeschalten und erzeuge es selbst.
Wir haben zum Beispiele eine Tabelle, die auf einer Spalte ein unique-constraint hat. JVx nimmt immer diese Spalte her, auch wenn ich sie in der View garnicht mitnehme. Und woher JVx das "current_user" hat (das ist weder eine Spalte, ein Key, noch ein Constraint) ist mir auch nicht klar. Aber die Frage ist beantwortet, danke!
alladinbp
 
Posts: 39
Joined: Tue Oct 11, 2011 2:27 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby JoergAladin » Mon Jan 16, 2012 12:28 pm

Hallo zusammen,

auch ich propiere mich gerade noch an den automatischen Verbindungen zwischen Tabellen. Umgebung: JVx 1.0, hsqldb/h2. Folgendes Szenario:

Code: Select all
Table MASTER
  id integer indentity
  name varchar(255)
  slave_id integer


Code: Select all
Table SLAVE
  id integer identity
  slavename varchar(255) unique


Code: Select all
FK: MASTER.slave_id -> SLAVE.id


Erwartet hätte ich, dass eine automatische Combobox für die SLAVE-Referenz bei Verwendung von MASTER als Datenquelle erzeugt wird. Wenn ich http://forum.sibvisions.com/viewtopic.php?f=5&t=44&p=58&hilit=datenbank+showcase#p58 richtig verstanden habe, sollte dies auch funktionieren. Schaltet man das Logging ein, erscheint allerdings ein Fehler:

"Column 'SLAVE_SLAVENAME' doesn't exists in MetaData!"


Ursache scheint eine vorher automatisch abgefeuerte SELECT-Abfrage zu sein:

Code: Select all
SELECT m.ID, m.NAME, m.SLAVE_ID, l1.SLAVENAME SLAVE_SLAVENAME FROM MASTER m LEFT OUTER JOIN PUBLIC.SLAVE l1 ON m.SLAVE_ID = l1.ID


Bei den von mir ausprobierten Datenbanken hsqldb und h2 liefert die SELECT-Abfrage nur folgende Spalten (auch mit externen Tools wie Squirrel): ID, NAME, SLAVE_ID, SLAVENAME . Ebenso liefert JVx nur die genannten Spalten als Ergebnis der SELECT-Abfrage. Die Umbenennung der Spalte SLAVENAME in SLAVE_SLAVENAME im Ergebnis funktioniert nicht.

Bei Erstellen einer eigenen View mit folgendem Aussehen

Code: Select all
VIEW V_MASTER
  id
  name
  slave_id
  slave_slavename


und Setzen der VIEW als Datenquelle für das DBStorage funktioniert das ganze wieder. Ist das ganze ein Bug? Wie muss ich meine Tabellen anlegen, damit das automatische Erstellen von Comboboxen auch ohne Views funktioniert?

Hilfreich wären ebenfalls die .sql-Scripts um die Datenbank der showcase-Application nachvollziehen zu können.

Danke für das wunderbare Framework!
JoergAladin
 
Posts: 5
Joined: Mon Jan 16, 2012 12:06 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby Support@SIB » Mon Jan 16, 2012 2:46 pm

Das Datenbankscript ist hier enthalten.
User avatar
Support@SIB
 
Posts: 353
Joined: Mon Sep 28, 2009 1:56 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby Development@SIB » Mon Jan 16, 2012 3:12 pm

Das Problem ist nicht nachvollziehbar!

Wir haben die Tabellen wie folgt erstellt:

Code: Select all
create table SLAVE
(
  id integer identity,
  slavename varchar(255),
  constraint SLAV_UK unique (slavename)
)

create table MASTER
(
  id integer identity,
  name varchar(255),
  slave_id integer,
  constraint MAST_SLAV_ID foreign key (slave_id) references SLAVE (id)
)


Die DBStorage wurde wie folgt definiert:

Code: Select all
public DBStorage getMaster() throws Exception
{
   DBStorage dbs = (DBStorage)get("master");
   
   if (dbs == null)
   {
      dbs = getDBAccess().createStorage();
      dbs.setWritebackTable("MASTER");
      dbs.setAutoLinkReference(true);         
      dbs.open();
      
      put("master", dbs);
   }
   
   return dbs;
}


Und der Client verwendet ein simples RemoteDataBook:

Code: Select all
...

RemoteDataBook rdbMaster = new RemoteDataBook();
rdbMaster.setDataSource(dataSource);
rdbMaster.setName("master");
rdbMaster.open();


Wenn Sie in die SLAVE Tabelle vorab Werte einfügen:

Code: Select all
INSERT INTO SLAVE (id, slavename) VALUES  (1, 'First')
INSERT INTO SLAVE (id, slavename) VALUES  (2, 'Second')


dann sollte Ihre Table die Auswahlliste für SLAVE auch anbieten:

autolink.png
autolink.png (4.14 KiB) Viewed 18952 times


Hilfreich wäre es, wenn Sie ihre vollständigen create Statements gepostet hätten, z.B. bei Ihrer Master Table steht indentity anstatt identity. Ansonsten ist die Herstellung Ihres Testfalles mühsame Kleinarbeit und kann auch schon mal viel Zeit in Anspruch nehmen!
User avatar
Development@SIB
 
Posts: 325
Joined: Mon Sep 28, 2009 1:54 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby JoergAladin » Mon Jan 16, 2012 3:54 pm

Hallo Development@SIB,

erstmal herzlichen Dank für die rasche Bearbeitung und die Antwort. Dies ist bei weitem nicht selbstverständlich. Weiterhin 'Entschuldigung' für das nicht optimale Posting (gelobe Besserung).

Ich werde versuchen ihre Tipps auszunehmen und die Anwendung nachzubauen.
JoergAladin
 
Posts: 5
Joined: Mon Jan 16, 2012 12:06 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby Development@SIB » Mon Jan 16, 2012 4:12 pm

In unserem Test verwendeten wir:

Specification-Title: HSQLDB
Specification-Version: 1.8.0.10


Sie haben geschrieben hsqldb/h2 - welche Variante und Version verwenden Sie genau?
Um H2 zu verwenden, müssten Sie sich selbst um den JDBC Treiber kümmern?
User avatar
Development@SIB
 
Posts: 325
Joined: Mon Sep 28, 2009 1:54 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby JoergAladin » Mon Jan 16, 2012 4:16 pm

Die HSQLDB Version lautet 2.2.6

Die H2* Treiber habe ich entsprechend in den BuildPath eingebunden und spreche die Datenbank über die allgemeine DBAccess-Klasse an.

[Ergänzung]

Problem existiert weiterhin auf meinem System auch mit HSQLDB 1.8.1.3

Vorgehen:
Datenbank angelegt, SQL-Skripte gemäß Foreneintrag ausgeführt. Logeintrag:

16.01.2012 16:03:52 [ FINE ] com.sibvisions.rad.persist.jdbc.DBAccess getColumnMetaData (Line: -1)
getMetaData(SELECT m.ID, m.NAME, m.SLAVE_ID, l1.SLAVENAME SLAVE_SLAVENAME FROM MASTER m LEFT OUTER JOIN PUBLIC.SLAVE l1 ON m.SLAVE_ID = l1.ID
WHERE 1=2 ) in 3ms
16.01.2012 16:03:52 [ FINE ] [ID, NAME, SLAVE_ID, SLAVENAME] com.sibvisions.rad.persist.jdbc.DBStorage getMetaData (Line: -1)
16.01.2012 16:03:52 [ FINE ] com.sibvisions.rad.persist.jdbc.DBStorage getMetaData (Line: -1)
javax.rad.model.ModelException: Column 'SLAVE_SLAVENAME' doesn't exists in MetaData!


Gerne stelle ich das Eclipse-Projekt zur Verfuegung. Da bei mir allerdings der Weg über die VIEWS funktioniert, werde ich selber von weiteren Nachforschungen absehen.
JoergAladin
 
Posts: 5
Joined: Mon Jan 16, 2012 12:06 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby Development@SIB » Mon Jan 16, 2012 5:42 pm

Mit HSQLDB 2.2.7 ist das "Problem" nachvollziehbar. Es dürfte seit HSQLDB 2.0 bestehen und hängt mit einer Änderung in der Alias Auswertung zusammen, siehe

http://comments.gmane.org/gmane.comp.ja ... .user/5408
bzw.
http://hsqldb.org/doc/2.0/guide/dbprope ... tml#N14AEF

Sie können versuchen ein Select Statement abzusetzen z.B.:

Code: Select all
select id, name as mastername from master

und sollten die Spalten id, name als Ergebnis erhalten. Erwartet hätten wir allerdings id, mastername.
Und genau deswegen funktionieren die automatischen Auswahllisten auch nicht.

Sie können folgende URL-Schreibweise verwenden:

Code: Select all
jdbc:hsqldb:hsql://localhost/db;get_column_name=false

oder Sie setzen vor <dbaccess>.open() folgende Property:

Code: Select all
<dbaccess>.setDBProperty("get_column_name", "false");

damit ein Spalten Alias wie definiert geliefert wird.

In der nächsten JVx Version wird die Property bereits gesetzt sein.
User avatar
Development@SIB
 
Posts: 325
Joined: Mon Sep 28, 2009 1:54 pm

Re: ModelException Nicht existierende Spalte existiert nicht

Postby JoergAladin » Tue Jan 17, 2012 10:07 am

Herzlichen Dank für die Beteiligung an der Fehlersuche. Das Programm läuft nun auch bei mir.
JoergAladin
 
Posts: 5
Joined: Mon Jan 16, 2012 12:06 pm


Return to Development (DE)