Search in sources :

Example 1 with JSTable

use of com.servoy.j2db.dataprocessing.JSTable in project servoy-client by Servoy.

the class JSDataSource method getTable.

/**
 * Get the table of a datasource.
 *
 * @return JSTable table
 */
@JSFunction
public JSTable getTable() {
    try {
        ITable table = application.getFoundSetManager().getTable(datasource);
        IServer server = application.getSolution().getServer(table.getServerName());
        if (server != null) {
            return new JSTable(table, server);
        }
    } catch (RepositoryException e) {
        Debug.log(e);
    }
    return null;
}
Also used : IServer(com.servoy.j2db.persistence.IServer) JSTable(com.servoy.j2db.dataprocessing.JSTable) ITable(com.servoy.j2db.persistence.ITable) RepositoryException(com.servoy.j2db.persistence.RepositoryException) JSFunction(org.mozilla.javascript.annotations.JSFunction)

Aggregations

JSTable (com.servoy.j2db.dataprocessing.JSTable)1 IServer (com.servoy.j2db.persistence.IServer)1 ITable (com.servoy.j2db.persistence.ITable)1 RepositoryException (com.servoy.j2db.persistence.RepositoryException)1 JSFunction (org.mozilla.javascript.annotations.JSFunction)1