Package org.sql.generation.api.grammar.builders.modification

Examples of org.sql.generation.api.grammar.builders.modification.ColumnSourceByValuesBuilder


    {
        ModificationFactory m = vendor.getModificationFactory();
        LiteralFactory l = vendor.getLiteralFactory();
        TableReferenceFactory t = vendor.getTableReferenceFactory();

        ColumnSourceByValuesBuilder columnBuilder = m.columnSourceByValues();
        for( Integer x = 0; x < amountOfColumns; ++x )
        {
            columnBuilder.addValues( l.param() );
        }

        return m.insert().setTableName( t.tableName( schemaName, tableName ) )
            .setColumnSource( columnBuilder.createExpression() ).createExpression();
    }
View Full Code Here


        String tableName = qNameInfo.getTableName();
        ModificationFactory m = vendor.getModificationFactory();
        TableReferenceFactory t = vendor.getTableReferenceFactory();
        LiteralFactory l = vendor.getLiteralFactory();

        ColumnSourceByValuesBuilder columnBuilder = m.columnSourceByValues()
            .addValues( l.param(), l.param(), l.param() );
        if( qNameInfo.getCollectionDepth() > 0 )
        {
            columnBuilder.addValues( l.func( "text2ltree", l.param() ) );
        }
        columnBuilder.addValues( l.param() );

        return m.insert().setTableName( t.tableName( this._state.schemaName().get(), tableName ) )
            .setColumnSource( columnBuilder.createExpression() ).createExpression();
    }
View Full Code Here

        ModificationFactory m = vendor.getModificationFactory();
        LiteralFactory l = vendor.getLiteralFactory();
        TableReferenceFactory t = vendor.getTableReferenceFactory();
        ColumnsFactory c = vendor.getColumnsFactory();

        ColumnSourceByValuesBuilder columnBuilder = m.columnSourceByValues();
        columnBuilder.addValues( ValueSource.Default.INSTANCE );
        for( Integer x = 1; x < AMOUNT_OF_COLUMNS_IN_ENTITY_TABLE; ++x )
        {
            columnBuilder.addValues( l.param() );
        }

        return ( (PgSQLInsertStatementBuilder) m.insert() )
            .setReturningClause(
                vendor.getQueryFactory().columnsBuilder()
                .addUnnamedColumns( c.colName( DBNames.ENTITY_TABLE_PK_COLUMN_NAME ) )
                .createExpression()
            )
            .setTableName( t.tableName( schemaName, tableName ) )
            .setColumnSource( columnBuilder.createExpression() )
            .createExpression();
    }
View Full Code Here

TOP

Related Classes of org.sql.generation.api.grammar.builders.modification.ColumnSourceByValuesBuilder

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.