Package com.esri.sde.sdk.client

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


  public List<String> retrieveMetadata() throws Exception {
    System.out.println("start retrieve metadata");
    List<String> results = new ArrayList<String>();
    try
      // query table containing XML metadata
      SeSqlConstruct sqlConstruct = new SeSqlConstruct();
      String[] tables = {METADATA_TABLE };
      sqlConstruct.setTables(tables);
      String[] propertyNames = { METADATA_COLUMN };     
      SeQuery query = new SeQuery(seConnection);
      query.prepareQuery(propertyNames, sqlConstruct);
      query.execute();
     
View Full Code Here


            seQuery = session.issue(new Command<SeQuery>() {
                @Override
                public SeQuery execute(ISession session, SeConnection connection)
                        throws SeException, IOException {
                    SeQuery seQuery = new SeQuery(connection, new String[] { "ROW_ID", "INT32_COL",
                            "STRING_COL" }, new SeSqlConstruct(typeName, whereClause));
                    seQuery.prepareQuery();
                    seQuery.execute();
                    return seQuery;
                }
            });
View Full Code Here

        @Override
        public Void execute(ISession session, SeConnection connection) throws SeException,
                IOException {

            final SeSqlConstruct sqlConstruct = new SeSqlConstruct(rasterTable);
            /*
             * Filter by the given raster id
             */
            final String rasterIdFilter = rasterColumn + " = " + rasterId;
            sqlConstruct.setWhere(rasterIdFilter);

            final String[] rasterColumns = { rasterColumn };
            preparedQuery = new SeQuery(connection, rasterColumns, sqlConstruct);
            preparedQuery.prepareQuery();
            preparedQuery.execute();
View Full Code Here

     */
    @Test
    public void testApiOrderBy() throws Exception {
        ISession session = store.getSession(Transaction.AUTO_COMMIT);

        SeSqlConstruct sqlConstruct = new SeSqlConstruct();
        String[] tables = { InProcessViewSupportTestData.MASTER, InProcessViewSupportTestData.CHILD };
        sqlConstruct.setTables(tables);
        String where = InProcessViewSupportTestData.CHILD + ".MASTER_ID = "
                + InProcessViewSupportTestData.MASTER + ".ID";
        sqlConstruct.setWhere(where);

        // tricky part is that SHAPE column must always be the last one
        String[] propertyNames = { InProcessViewSupportTestData.MASTER + ".ID AS myid2",
                InProcessViewSupportTestData.MASTER + ".NAME AS MNAME",
                InProcessViewSupportTestData.CHILD + ".ID",
View Full Code Here

    @Test
    @Ignore
    public void testApiAlias() throws Exception {
        ISession session = store.getSession(Transaction.AUTO_COMMIT);

        SeSqlConstruct sqlConstruct = new SeSqlConstruct();
        String[] tables = { InProcessViewSupportTestData.MASTER + " MASTER",
                InProcessViewSupportTestData.CHILD + " CHILD" };
        sqlConstruct.setTables(tables);
        String where = "CHILD.MASTER_ID = MASTER.ID";
        sqlConstruct.setWhere(where);

        // tricky part is that SHAPE column must always be the last one
        String[] propertyNames = { "MASTER.ID", "CHILD.NAME", "MASTER.SHAPE" };

        final int shapeIndex = 2;
View Full Code Here

     */
    @Test
    public void testApiGroupBy() throws Exception {
        ISession session = store.getSession(Transaction.AUTO_COMMIT);

        SeSqlConstruct sqlConstruct = new SeSqlConstruct();
        String[] tables = { InProcessViewSupportTestData.MASTER, InProcessViewSupportTestData.CHILD };
        sqlConstruct.setTables(tables);
        String where = InProcessViewSupportTestData.CHILD + ".MASTER_ID = "
                + InProcessViewSupportTestData.MASTER + ".ID";
        sqlConstruct.setWhere(where);

        // tricky part is that SHAPE column must always be the last one
        String[] propertyNames = { InProcessViewSupportTestData.MASTER + ".ID",
                InProcessViewSupportTestData.CHILD + ".NAME" /*
                                                              * , MASTER + ".SHAPE"
View Full Code Here

            SeQuery query;
            SeQueryInfo queryInfo;

            queryInfo = new SeQueryInfo();
            queryInfo.setColumns(new String[] { "SHAPE" });
            queryInfo.setConstruct(new SeSqlConstruct(typeName));

            long runTime = 0;
            for (int run = 0; run < numRuns; run++) {
                query = new SeQuery(conn);
                runTime += iterateWithSeShapeFetching(query, queryInfo);
View Full Code Here

            SeQuery query;
            SeQueryInfo queryInfo;

            queryInfo = new SeQueryInfo();
            queryInfo.setColumns(new String[] { "SHAPE" });
            queryInfo.setConstruct(new SeSqlConstruct(typeName));

            long runTime = 0;
            for (int run = 0; run < numRuns; run++) {
                query = new SeQuery(conn);
                runTime += iterateWithGeometryFactory(query, queryInfo);
View Full Code Here

        final Filter filter = query.getFilter();
        final FIDReader fidReader = FIDReader.NULL_READER;

        // the first table has to be the main layer
        final SeSqlConstruct construct;
        try {
            construct = definitionQuery.getConstruct();
        } catch (SeException e) {
            throw new ArcSdeException("shouldn't happen: " + e.getMessage(), e);
        }
        final String[] tables = construct.getTables();
        String layerName = tables[0];
        // @REVISIT: HACK HERE!, look how to get rid of alias in
        // query info, or
        // better stop using queryinfo as definition query and use
        // the PlainSelect,
View Full Code Here

    }

    private String toString(SeQueryInfo qInfo) {
        StringBuffer sb = new StringBuffer("SeQueryInfo[\n\tcolumns=");
        try {
            SeSqlConstruct sql = qInfo.getConstruct();
            String[] tables = sql.getTables();
            String[] cols = qInfo.getColumns();
            String by = null;
            try {
                by = qInfo.getByClause();
            } catch (NullPointerException npe) {
                // no-op
            }
            String where = sql.getWhere();
            for (int i = 0; cols != null && i < cols.length; i++) {
                sb.append(cols[i]);
                if (i < cols.length - 1)
                    sb.append(", ");
            }
View Full Code Here

TOP

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

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.