Package com.esri.sde.sdk.client

Examples of com.esri.sde.sdk.client.SeQuery


                + InProcessViewSupportTestData.CHILD + " ON " + InProcessViewSupportTestData.CHILD
                + ".MASTER_ID = " + InProcessViewSupportTestData.MASTER + ".ID";

        final int shapeIndex = 1;
        final int expectedCount = 7;
        final SeQuery query = session.issue(new Command<SeQuery>() {

            @Override
            public SeQuery execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeQuery query = new SeQuery(connection);
                query.prepareSql(plainQuery);
                query.execute();
                return query;
            }
        });

        try {
View Full Code Here


    public void testEmptySQLConstruct() throws Exception {
        String typeName = testData.getTempTableName();
        String[] columns = { TestData.TEST_TABLE_COLS[0] };
        SeSqlConstruct sql = new SeSqlConstruct(typeName);

        SeQuery rowQuery = null;
        try {
            rowQuery = session.createAndExecuteQuery(columns, sql);
        } finally {
            if (rowQuery != null) {
                session.close(rowQuery);
View Full Code Here

        final Command<Integer> countCmd = new Command<Integer>() {
            @Override
            public Integer execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                final SeQuery rowQuery = new SeQuery(connection, columns, sql);
                rowQuery.setSpatialConstraints(SeQuery.SE_OPTIMIZE, false, spatFilters);
                rowQuery.prepareQuery();
                rowQuery.execute();

                // fetch some rows
                rowQuery.fetch();
                rowQuery.fetch();
                rowQuery.fetch();

                SeQuery countQuery = new SeQuery(connection, columns, sql);
                countQuery.setSpatialConstraints(SeQuery.SE_OPTIMIZE, true, spatFilters);

                SeTable.SeTableStats tableStats = countQuery.calculateTableStatistics("POP_ADMIN",
                        SeTable.SeTableStats.SE_COUNT_STATS, qInfo, 0);

                rowQuery.fetch();
                rowQuery.fetch();

                int resultCount = tableStats.getCount();

                rowQuery.close();
                countQuery.close();
                return new Integer(resultCount);
            }
        };
        final Integer resultCount = session.issue(countCmd);
        final int expCount = 2;
View Full Code Here

                SeSqlConstruct sql = new SeSqlConstruct(tableName);
                if (whereClause != null) {
                    sql.setWhere(whereClause);
                }
                SeQuery query = new SeQuery(connection, columns, sql);

                if (state != null) {
                    SeObjectId differencesId = new SeObjectId(SeState.SE_NULL_STATE_ID);
                    query.setState(state.getId(), differencesId, SeState.SE_STATE_DIFF_NOCHECK);
                }
                SeQueryInfo qInfo = new SeQueryInfo();
                qInfo.setConstruct(sql);

                if (spatFilters != null) {
                    query.setSpatialConstraints(SeQuery.SE_OPTIMIZE, true, spatFilters);
                }

                SeTable.SeTableStats tableStats = query.calculateTableStatistics("INT32_COL",
                        SeTable.SeTableStats.SE_COUNT_STATS, qInfo, 0);

                int actualCount = tableStats.getCount();
                query.close();
                return new Integer(actualCount);
            }
        };

        final Integer count = session.issue(countCmd);
View Full Code Here

        SeExtent extent = session.issue(new Command<SeExtent>() {
            @Override
            public SeExtent execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeQuery spatialQuery = new SeQuery(connection);
                // spatialQuery.setSpatialConstraints(SeQuery.SE_OPTIMIZE,
                // false, filters);
                SeExtent extent = spatialQuery.calculateLayerExtent(seQueryInfo);
                return extent;
            }
        });

        double minX = Math.round(extent.getMinX());
View Full Code Here

        SeExtent extent = session.issue(new Command<SeExtent>() {

            @Override
            public SeExtent execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeQuery spatialQuery = new SeQuery(connection);
                spatialQuery.setSpatialConstraints(SeQuery.SE_SPATIAL_FIRST, false, spatFilters);

                SeExtent extent = spatialQuery.calculateLayerExtent(seQueryInfo);
                return extent;
            }
        });

        // just checking the extent were returned, which is something as I get
View Full Code Here

        SeExtent extent = session.issue(new Command<SeExtent>() {
            @Override
            public SeExtent execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeQuery spatialQuery = new SeQuery(connection);
                spatialQuery.setSpatialConstraints(SeQuery.SE_OPTIMIZE, false, spatFilters);

                SeExtent extent = spatialQuery.calculateLayerExtent(seQueryInfo);
                return extent;
            }
        });

        assertNotNull(extent);
View Full Code Here

    @Test
    public void testDeleteById() throws IOException, UnavailableConnectionException, SeException {

        final String typeName = testData.getTempTableName();
        final SeQuery query = session.createAndExecuteQuery(new String[] { "ROW_ID", "INT32_COL" },
                new SeSqlConstruct(typeName));

        final int rowId;
        try {
            SdeRow row = session.fetch(query);
            rowId = row.getInteger(0).intValue();
        } finally {
            session.close(query);
        }

        session.issue(new Command<Void>() {
            @Override
            public Void execute(ISession session, SeConnection connection) throws SeException,
                    IOException {
                SeDelete delete = new SeDelete(connection);
                delete.byId(typeName, new SeObjectId(rowId));
                delete.close();
                return null;
            }
        });

        final String whereClause = "ROW_ID=" + rowId;
        final SeSqlConstruct sqlConstruct = new SeSqlConstruct(typeName, whereClause);
        final SeQuery deletedQuery = session.createAndExecuteQuery(new String[] { "ROW_ID" },
                sqlConstruct);

        SdeRow row = session.fetch(deletedQuery);
        assertNull(whereClause + " should have returned no records as it was deleted", row);
    }
View Full Code Here

            final SeRow transRow = transSession.issue(new Command<SeRow>() {
                @Override
                public SeRow execute(ISession session, SeConnection connection) throws SeException,
                        IOException {
                    // the query over the transaction connection
                    SeQuery transQuery = new SeQuery(connection, columns, sqlConstruct);
                    // transaction is not committed, so transQuery should give
                    // the
                    // inserted
                    // record and query don't
                    transQuery.prepareQuery();
                    transQuery.execute();
                    SeRow transRow = transQuery.fetch();
                    // querying over a transaction in progress does give diff
                    // assertEquals(Integer.valueOf(50), transRow.getInteger(0))
                    transQuery.close();
                    return transRow;
                }
            });

            assertNotNull(transRow);

            // commit transaction
            transSession.commitTransaction();
            commited = true;

            final SeRow noTransRow = session.issue(new Command<SeRow>() {
                @Override
                public SeRow execute(ISession session, SeConnection connection) throws SeException,
                        IOException {
                    SeQuery query = new SeQuery(connection, columns, sqlConstruct);
                    query.prepareQuery();
                    query.execute();
                    SeRow row = query.fetch();
                    query.close();
                    return row;
                }
            });

            assertNotNull(noTransRow);
View Full Code Here

                false, SeRaster.SE_INTERPOLATION_NEAREST, 9);

        ISessionPool pool = testData.getConnectionPool();
        ISession conn = pool.getSession();

        final SeQuery q = conn.createAndExecuteQuery(new String[] { "RASTER" }, new SeSqlConstruct(
                tableName));

        try {
            pyramid = conn.issue(new Command<RasterInfo>() {
                @Override
                public RasterInfo execute(ISession session, SeConnection connection)
                        throws SeException, IOException {
                    SeRow r = q.fetch();
                    SeRasterAttr rAttr = r.getRaster(0);

                    SeObjectId rasterColumnId = rAttr.getRasterColumnId();
                    SeRasterColumn rasterColumn = new SeRasterColumn(connection, rasterColumnId);
                    SeCoordinateReference coordRef = rasterColumn.getCoordRef();
View Full Code Here

TOP

Related Classes of com.esri.sde.sdk.client.SeQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.