Examples of XColumnsSupplier


Examples of com.sun.star.sdbcx.XColumnsSupplier

            Helper.setUnoPropertyValue(xRowSet, PropertyNames.COMMAND_TYPE, new Integer(_nCommandType)); // CommandType
            xExecute.executeWithCompletion(xInteraction);
            com.sun.star.sdb.XResultSetAccess xResultAccess = UnoRuntime.queryInterface(com.sun.star.sdb.XResultSetAccess.class, xRowSet);
            ResultSet = xResultAccess.createResultSet();
            xResultSetRow = UnoRuntime.queryInterface(com.sun.star.sdbc.XRow.class, ResultSet);
            XColumnsSupplier xDBCols = UnoRuntime.queryInterface(XColumnsSupplier.class, ResultSet);
            xColumns = xDBCols.getColumns();
            setCommandType(_nCommandType);
            return true;
        }
        catch (Exception exception)
        {
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

                    String scurreftablename = AnyConverter.toString(xPropertySet.getPropertyValue("ReferencedTable"));
                    if (getTableNamesAsNameAccess().hasByName(scurreftablename))
                    {
                        if (scurreftablename.equals(_sreferencedtablename))
                        {
                            XColumnsSupplier xColumnsSupplier = UnoRuntime.queryInterface(XColumnsSupplier.class, xPropertySet);
                            String[] smastercolnames = xColumnsSupplier.getColumns().getElementNames();
                            skeycolumnnames = new String[2][smastercolnames.length];
                            skeycolumnnames[0] = smastercolnames;
                            skeycolumnnames[1] = new String[smastercolnames.length];
                            for (int n = 0; n < smastercolnames.length; n++)
                            {
                                XPropertySet xcolPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xColumnsSupplier.getColumns().getByName(smastercolnames[n]));
                                skeycolumnnames[1][n] = AnyConverter.toString(xcolPropertySet.getPropertyValue("RelatedColumn"));
                            }
                            return skeycolumnnames;
                        }
                    }
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

            if (xSuppParams != null)
            {
                parameters = xSuppParams.getParameters();
            }

            final XColumnsSupplier columnsSup = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, rowSet);
            final XNameAccess columns = columnsSup.getColumns();
            final String[] columnNamesList = columns.getElementNames();
            final XResultSetMetaDataSupplier sup = (XResultSetMetaDataSupplier) UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, rowSet);
            final XResultSetMetaData resultSetMetaData = sup.getMetaData();

            columnCount = resultSetMetaData.getColumnCount();
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

            final XIndexAccess groupColumns = m_composer.getGroupColumns();
            assertTrue("Group columns doesn't exist: \"City\"",
            groupColumns != null && groupColumns.getCount() == 1 && groupColumns.getByIndex(0) != null);
           
            // XColumnsSupplier
            final XColumnsSupplier xSelectColumns = UnoRuntime.queryInterface(XColumnsSupplier.class, m_composer);
            assertTrue("no select columns, or wrong number of select columns",
            xSelectColumns != null && xSelectColumns.getColumns() != null && xSelectColumns.getColumns().getElementNames().length == 6);

            // structured filter
            m_composer.setQuery("SELECT \"ID\", \"Postal\", \"Address\" FROM \"customers\"");
            m_composer.setFilter(COMPLEXFILTER);
            final PropertyValue[][] aStructuredFilter = m_composer.getStructuredFilter();
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

        if (queries.hasByName(queryNames[i]))
                {
                  final XPropertySet query = UnoRuntime.queryInterface(
                      XPropertySet.class, queries.getByName( queryNames[i] ) );

                  final XColumnsSupplier suppCols = UnoRuntime.queryInterface(
                      XColumnsSupplier.class, query);
                  final XIndexAccess columns = UnoRuntime.queryInterface(
                          XIndexAccess.class, suppCols.getColumns());

                  // check whether the columns supplied by the query match what we expected
                  assertTrue( "invalid column count (found " + columns.getCount() + ", expected: " + expectedColumnNames[i].length + ") for query \"" + queryNames[i] + "\"",
                      columns.getCount() == expectedColumnNames[i].length );
                  for ( int col = 0; col < columns.getCount(); ++col )
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

        createTestCase(true);

        // first we create our RowSet object
        final RowSetEventListener pRow = new RowSetEventListener();

        final XColumnsSupplier colSup = UnoRuntime.queryInterface( XColumnsSupplier.class, m_rowSet );
        final XPropertySet col = UnoRuntime.queryInterface( XPropertySet.class, colSup.getColumns().getByName( "ID" ) );
        col.addPropertyChangeListener("Value", pRow);
        m_rowSetProperties.addPropertyChangeListener("IsModified", pRow);
        m_rowSetProperties.addPropertyChangeListener("IsNew", pRow);
        m_rowSetProperties.addPropertyChangeListener("IsRowCountFinal", pRow);
        m_rowSetProperties.addPropertyChangeListener("RowCount", pRow);
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

    }

    // misc
    public int getColumnCount()
    {
        XColumnsSupplier suppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
            XColumnsSupplier.class, m_rowSet );
        XIndexAccess columns = (XIndexAccess)UnoRuntime.queryInterface(
            XIndexAccess.class, suppCols.getColumns() );
        return columns.getCount();
    }
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

            // So we need to ensure that we do not change the IsModified property with whatever we do
            Object aModifiedFlag = xFormProps.getPropertyValue( "IsModified" );


            // get the columns of our master form
            XColumnsSupplier xSuppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
              XColumnsSupplier.class, xFormProps );
            XNameAccess xCols = xSuppCols.getColumns();

            // and update the date column with a NULL value
            XColumnUpdate xDateColumn = (XColumnUpdate)UnoRuntime.queryInterface(
              XColumnUpdate.class, xCols.getByName( "SALEDATE" ) );
            xDateColumn.updateNull();
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

                break;
        }

        // needed in various states:
        XNameAccess xObjectCollection = null;
        XColumnsSupplier xSupplyColumns = null;

        try
        {
            // go!
            while ((DONE != eState) && (FAILED != eState))
            {
                switch (eState)
                {
                    case HANDLE_TABLE:
                    {
                        // initial state for handling the tables

                        // get the table objects
                        final XTablesSupplier xSupplyTables = (XTablesSupplier) UnoRuntime.queryInterface(XTablesSupplier.class, connection);
                        if (xSupplyTables != null)
                        {
                            xObjectCollection = xSupplyTables.getTables();
                            // if something went wrong 'til here, then this will be handled in the next state

                            // next state: get the object
                            }
                        eState = RETRIEVE_OBJECT;
                    }
                    break;

                    case HANDLE_QUERY:
                    {
                        // initial state for handling the tables

                        // get the table objects
                        final XQueriesSupplier xSupplyQueries = (XQueriesSupplier) UnoRuntime.queryInterface(XQueriesSupplier.class, connection);
                        if (xSupplyQueries != null)
                        {
                            xObjectCollection = xSupplyQueries.getQueries();
                            // if something went wrong 'til here, then this will be handled in the next state

                            // next state: get the object
                            }
                        eState = RETRIEVE_OBJECT;
                    }
                    break;

                    case RETRIEVE_OBJECT:
                        // here we should have an object (aka query or table) collection, and are going
                        // to retrieve the desired object

                        // next state: default to FAILED
                        eState = FAILED;

                        if (xObjectCollection != null && xObjectCollection.hasByName(command))
                        {
                            xSupplyColumns = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, xObjectCollection.getByName(command));

                            // next: go for the columns
                            eState = RETRIEVE_COLUMNS;
                        }
                        break;

                    case RETRIEVE_COLUMNS:
                        // next state: default to FAILED
                        eState = FAILED;

                        if (xSupplyColumns != null)
                        {
                            xFields = xSupplyColumns.getColumns();
                            // that's it
                            eState = DONE;
                        }
                        break;
View Full Code Here

Examples of com.sun.star.sdbcx.XColumnsSupplier

            if (xSuppParams != null)
            {
                parameters = xSuppParams.getParameters();
            }

            final XColumnsSupplier columnsSup = (XColumnsSupplier)UnoRuntime.queryInterface(XColumnsSupplier.class, rowSet);
            final XNameAccess columns = columnsSup.getColumns();
            final String[] columnNamesList = columns.getElementNames();
            final XResultSetMetaDataSupplier sup = (XResultSetMetaDataSupplier) UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, rowSet);
            final XResultSetMetaData resultSetMetaData = sup.getMetaData();

            columnCount = resultSetMetaData.getColumnCount();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.