Package org.apache.cocoon.acting.ModularDatabaseAccess

Examples of org.apache.cocoon.acting.ModularDatabaseAccess.AutoIncrementHelper.includeAsValue()


                    if ( queryData.columns[i].isKey && queryData.columns[i].isAutoIncrement ) {
                        dah = (AutoIncrementHelper) modeMapping.select( queryData.columns[i].mode );
                        if ( dah.includeInQuery() ) {
                            actualColumns++;
                            queryBuffer.append( queryData.columns[i].columnConf.getAttribute( "name" ) );
                            if ( dah.includeAsValue() ) {
                                valueBuffer.append( "?" );
                            } else {
                                valueBuffer.append(
                                                   dah.getSubquery( table, queryData.columns[i].columnConf,
                                                                    queryData.columns[i].modeConf ) );
View Full Code Here


    protected void storeKeyValue( Configuration tableConf, Column key, int rowIndex, Connection conn,
                                  Statement statement, Request request, Map results )
        throws SQLException, ConfigurationException, ComponentException {

        AutoIncrementHelper dah = (AutoIncrementHelper) modeMapping.select( key.mode );
        if (!dah.includeAsValue()) {
            String keyname = getOutputName( tableConf, key.columnConf, rowIndex );
            Object value = dah.getPostValue( tableConf, key.columnConf, key.modeConf, conn, statement, request );
            if (getLogger().isDebugEnabled())
                getLogger().debug( "Retrieving autoincrement for " + keyname + "as " + value );
            setRequestAttribute( request, keyname, value );
View Full Code Here

        int columnCount = 0;

        AutoIncrementHelper dah = (AutoIncrementHelper) modeMapping.select( column.mode );
        if ( dah.includeInQuery() ) {
            if ( dah.includeAsValue() ) {
                Object value = dah.getPreValue( table, column.columnConf, column.modeConf, conn, request );
                String keyname = this.getOutputName( table, column.columnConf, rowIndex );
                if (getLogger().isDebugEnabled())
                    getLogger().debug( "Setting key " + keyname + " to " + value );
                statement.setObject( currentIndex, value );
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.