Package org.jooq.util

Examples of org.jooq.util.SchemaDefinition


     * {@inheritDoc}
     */
    @Override
    protected void loadUniqueKeys(DefaultRelations relations) throws SQLException {
        for (Record record : fetchKeys("U")) {
            SchemaDefinition schema = getSchema(record.getValue(Sysschemas.SCHEMANAME));
            String key = record.getValue(Sysconstraints.CONSTRAINTNAME);
            String tableName = record.getValue(Systables.TABLENAME);
            String descriptor = record.getValueAsString(Sysconglomerates.DESCRIPTOR);

            TableDefinition table = getTable(schema, tableName);
View Full Code Here


          .join("sys.sysconstraints   pc").on("pc.constraintid = f.keyconstraintid")
          .join("sys.sysschemas       ps").on("pc.schemaid = ps.schemaid")
          .where("fc.type = 'F'")
          .fetch()) {

          SchemaDefinition foreignKeySchema = getSchema(record.getValue(fkSchema));
          SchemaDefinition uniqueKeySchema = getSchema(record.getValue(ukSchema));

          String foreignKeyName = record.getValue(fkName);
            String foreignKeyTableName = record.getValue(fkTable);
            List<Integer> foreignKeyIndexes = decode(record.getValueAsString(fkDescriptor));
            String uniqueKeyName = record.getValue(ukName);
View Full Code Here

        for (String name : create()
                .select(Sysschemas.SCHEMANAME)
                .from(SYSSCHEMAS)
                .fetch(Sysschemas.SCHEMANAME)) {

            result.add(new SchemaDefinition(this, name, ""));
        }

        return result;
    }
View Full Code Here

                .orderBy(
                    Sysschemas.SCHEMANAME,
                    Syssequences.SEQUENCENAME)
                .fetch()) {

            SchemaDefinition schema = getSchema(record.getValue(Sysschemas.SCHEMANAME));

            DataTypeDefinition type = new DefaultDataTypeDefinition(
                this,
                schema,
                record.getValue(Syssequences.SEQUENCEDATATYPE),
View Full Code Here

                .orderBy(
                    Sysschemas.SCHEMANAME,
                    Systables.TABLENAME)
              .fetch()) {

        SchemaDefinition schema = getSchema(record.getValue(Sysschemas.SCHEMANAME));
        String name = record.getValue(Systables.TABLENAME);
        String id = record.getValue(Systables.TABLEID);

        DerbyTableDefinition table = new DerbyTableDefinition(schema, name, id);
            result.add(table);
View Full Code Here

    }

    @Override
    protected void loadPrimaryKeys(DefaultRelations relations) throws SQLException {
        for (Record record : fetchKeys("P")) {
            SchemaDefinition schema = getSchema(record.getValue(trim(Iiconstraints.SCHEMA_NAME)));
            String key = record.getValue(trim(Iiconstraints.CONSTRAINT_NAME));
            String tableName = record.getValue(trim(Iiconstraints.TABLE_NAME));
            String columnName = record.getValue(trim(IiindexColumns.COLUMN_NAME));

            TableDefinition table = getTable(schema, tableName);
View Full Code Here

    }

    @Override
    protected void loadUniqueKeys(DefaultRelations relations) throws SQLException {
        for (Record record : fetchKeys("U")) {
            SchemaDefinition schema = getSchema(record.getValue(trim(Iiconstraints.SCHEMA_NAME)));
            String key = record.getValue(trim(Iiconstraints.CONSTRAINT_NAME));
            String tableName = record.getValue(trim(Iiconstraints.TABLE_NAME));
            String columnName = record.getValue(trim(IiindexColumns.COLUMN_NAME));

            TableDefinition table = getTable(schema, tableName);
View Full Code Here

                IirefConstraints.REF_CONSTRAINT_NAME.asc(),
                IiindexColumns.KEY_SEQUENCE.asc())
            .fetch();

        for (Record record : result) {
            SchemaDefinition foreignKeySchema = getSchema(record.getValue(trim(IirefConstraints.REF_SCHEMA_NAME)));
            SchemaDefinition uniqueKeySchema = getSchema(record.getValue(trim(IirefConstraints.UNIQUE_SCHEMA_NAME)));

            String foreignKey = record.getValue(trim(IirefConstraints.REF_CONSTRAINT_NAME));
            String foreignKeyTable = record.getValue(trim(IirefConstraints.REF_TABLE_NAME));
            String foreignKeyColumn = record.getValue(trim(IiindexColumns.COLUMN_NAME));
            String uniqueKey = record.getValue(trim(IirefConstraints.UNIQUE_CONSTRAINT_NAME));
View Full Code Here

        for (String name : create()
                .select(trim(Iischema.SCHEMA_NAME))
                .from(IISCHEMA)
                .fetch(trim(Iischema.SCHEMA_NAME))) {

            result.add(new SchemaDefinition(this, name, ""));
        }

        return result;
    }
View Full Code Here

                .orderBy(
                    Iisequences.SEQ_OWNER,
                    Iisequences.SEQ_NAME)
                .fetch()) {

            SchemaDefinition schema = getSchema(record.getValue(trim(Iisequences.SEQ_OWNER)));

            DataTypeDefinition type = new DefaultDataTypeDefinition(
                this, schema,
                record.getValue(trim(Iisequences.DATA_TYPE)), 0, 0, 0);
View Full Code Here

TOP

Related Classes of org.jooq.util.SchemaDefinition

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.