Error FindAll()

40 views
Skip to first unread message

Hugo Alexandre Aguera Viana

unread,
Apr 5, 2015, 10:19:05 PM4/5/15
to activejd...@googlegroups.com
Hi, I have problems as the search for FindAll () method, which is being added an "s" in the name of the most search class, see example:

        Operador operad = new Operador();
        List<Operador> operador = Operador.findAll();
        System.out.println(Operador.getMetaModel().getTableName());
        
        tbList.setItems(FXCollections.observableList(operador));
        c1.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Operador, String>, ObservableValue<String>>() {
            @Override
            public ObservableValue<String> call(TableColumn.CellDataFeatures<Operador, String> p) {
                return new SimpleStringProperty(p.getValue().getString("COPELOGIN"));
            }
        });

Exception ------ select * from OPERADORS and not OPERADOR

Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java
.lang.reflect.InvocationTargetException
        at javafx.fxml.FXMLLoader$MethodHandler.invoke(Unknown Source)
        at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown So
urce)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unkn
own Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknow
n Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknow
n Source)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(U
nknown Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at javafx.event.Event.fireEvent(Unknown Source)
        at javafx.scene.Node.fireEvent(Unknown Source)
        at javafx.scene.control.Button.fire(Unknown Source)
        at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Un
known Source)
        at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown S
ource)
        at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown S
ource)
        at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.h
andleBubblingEvent(Unknown Source)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unkn
own Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknow
n Source)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknow
n Source)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(U
nknown Source)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Sourc
e)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Sou
rce)
        at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
        at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
        at javafx.event.Event.fireEvent(Unknown Source)
        at javafx.scene.Scene$MouseHandler.process(Unknown Source)
        at javafx.scene.Scene$MouseHandler.access$1500(Unknown Source)
        at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotificatio
n.run(Unknown Source)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotificatio
n.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEve
nt$350(Unknown Source)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$264/114961325
3.get(Unknown Source)
        at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown
 Source)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unkn
own Source)
        at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
        at com.sun.glass.ui.View.notifyMouse(Unknown Source)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
        at com.sun.glass.ui.win.WinApplication$$Lambda$36/1963387170.run(Unknown
 Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        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 sun.reflect.misc.Trampoline.invoke(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
        ... 51 more
Caused by: org.javalite.activejdbc.DBException: org.h2.jdbc.JdbcSQLException: Ta
ble "OPERADORS" not found; SQL statement:
SELECT * FROM operadors [42102-176]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
        at org.h2.message.DbException.get(DbException.java:178)
        at org.h2.message.DbException.get(DbException.java:154)
        at org.h2.command.Parser.readTableOrView(Parser.java:5213)
        at org.h2.command.Parser.readTableFilter(Parser.java:1220)
        at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1859)
        at org.h2.command.Parser.parseSelectSimple(Parser.java:1968)
        at org.h2.command.Parser.parseSelectSub(Parser.java:1853)
        at org.h2.command.Parser.parseSelectUnion(Parser.java:1674)
        at org.h2.command.Parser.parseSelect(Parser.java:1662)
        at org.h2.command.Parser.parsePrepared(Parser.java:434)
        at org.h2.command.Parser.parse(Parser.java:306)
        at org.h2.command.Parser.parse(Parser.java:278)
        at org.h2.command.Parser.prepareCommand(Parser.java:243)
        at org.h2.engine.Session.prepareLocal(Session.java:442)
        at org.h2.server.TcpServerThread.process(TcpServerThread.java:265)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:160)
        at java.lang.Thread.run(Unknown Source)
, query: SELECT * FROM operadors
        at org.h2.engine.SessionRemote.done(SessionRemote.java:622)
        at org.h2.command.CommandRemote.prepare(CommandRemote.java:68)
        at org.h2.command.CommandRemote.<init>(CommandRemote.java:45)
        at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:492)
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1189)
        at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:7
2)
        at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:277)
        at org.javalite.activejdbc.DB.createStreamingPreparedStatement(DB.java:4
82)
        at org.javalite.activejdbc.DB.find(DB.java:463)
        at org.javalite.activejdbc.LazyList.hydrate(LazyList.java:335)
        at org.javalite.activejdbc.LazyList.size(LazyList.java:549)
        at com.sun.javafx.collections.ObservableSequentialListWrapper.size(Unkno
wn Source)
        at javafx.scene.control.TableView$TableViewArrayListSelectionModel.updat
eItemCount(Unknown Source)
        at javafx.scene.control.TableView$TableViewArrayListSelectionModel.updat
eItemsObserver(Unknown Source)
        at javafx.scene.control.TableView$TableViewArrayListSelectionModel.acces
s$1100(Unknown Source)
        at javafx.scene.control.TableView$6.invalidated(Unknown Source)
        at javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
        at javafx.beans.property.ObjectPropertyBase.set(Unknown Source)
        at javafx.scene.control.TableView.setItems(Unknown Source)
        at br.com.jactivejdbc.FXMLController.handleButtonActionList(FXMLControll
er.java:51)
        ... 60 more
Caused by: org.h2.jdbc.JdbcSQLException: Table "OPERADORS" not found; SQL statem
ent:
SELECT * FROM operadors [42102-176]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
        at org.h2.message.DbException.get(DbException.java:178)
        at org.h2.message.DbException.get(DbException.java:154)
        at org.h2.command.Parser.readTableOrView(Parser.java:5213)
        at org.h2.command.Parser.readTableFilter(Parser.java:1220)
        at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1859)
        at org.h2.command.Parser.parseSelectSimple(Parser.java:1968)
        at org.h2.command.Parser.parseSelectSub(Parser.java:1853)
        at org.h2.command.Parser.parseSelectUnion(Parser.java:1674)
        at org.h2.command.Parser.parseSelect(Parser.java:1662)
        at org.h2.command.Parser.parsePrepared(Parser.java:434)
        at org.h2.command.Parser.parse(Parser.java:306)
        at org.h2.command.Parser.parse(Parser.java:278)
        at org.h2.command.Parser.prepareCommand(Parser.java:243)
        at org.h2.engine.Session.prepareLocal(Session.java:442)
        at org.h2.server.TcpServerThread.process(TcpServerThread.java:265)
        at org.h2.server.TcpServerThread.run(TcpServerThread.java:160)
        at java.lang.Thread.run(Unknown Source)

        ... 80 more


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.jactivejdbc;

import org.javalite.activejdbc.Model;

/**
 *
 * @author hugo
 */
public class Operador extends Model{}

Igor Polevoy

unread,
Apr 6, 2015, 10:06:20 PM4/6/15
to activejd...@googlegroups.com
Hugo, I realized we were missing documentation explaining this behavior. 

Thanks

Hugo Alexandre Aguera Viana

unread,
Apr 6, 2015, 10:35:35 PM4/6/15
to activejd...@googlegroups.com
Tks..








--
You received this message because you are subscribed to a topic in the Google Groups "ActiveJDBC Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/activejdbc-group/GxGfKznIWLQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to activejdbc-gro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages