Exemplo n.º 1
0
def makeUpdateProcBody( table ):
        instanceName = table.makeName( Format.ada, Qualification.unqualified, ItemType.instanceName )
        template = Template( file=templatesPath()+"update.func.tmpl" )
        template.procedureHeader = makeUpdateProcHeader( table, CONNECTION_STRING, ' is' )
        #template.pkCriteria = makeCriterionList( table, 'pk_c', 'primaryKeyOnly', True )
        #template.inputCriteria = makeCriterionList( table, 'values_c', 'allButPrimaryKey', True )
        template.insertStrings = makeAliasedStrings( instanceName, table.variables )
        template.allParams = makeParamsBindings( instanceName, makeVariablesInUpdateOrder( table.variables ))
        return str(template) 
Exemplo n.º 2
0
def makeSaveProcBody( table ):
        template = Template( file=templatesPath()+"save.func.tmpl" )
        template.procedureHeader = makeSaveProcHeader( table, CONNECTION_STRING, ' is' )
        template.allCriteria = makeCriterionList( table, 'c', 'all', True )
        primaryKey = makePrimaryKeySubmitFields( table )
        template.tmpVariable = table.adaInstanceName + "_tmp"
        template.existsCheck = 'if( not is_Null( '+table.adaInstanceName + '_tmp )) then'
        template.updateCall = 'Update( '+ table.adaInstanceName + ', local_connection )'
        template.tmpVariableWithAssignment = table.adaInstanceName + "_tmp : " + table.adaQualifiedOutputRecord;
        template.has_pk = table.hasPrimaryKey()
        template.retrieveByPK = table.adaInstanceName + '_tmp := retrieve_By_PK( ' + primaryKey + ' )'
        s = str(template) 
        return s        
Exemplo n.º 3
0
def makeDeleteSpecificProcBody( table, connection_string ):
        instanceName = table.makeName( 
                Format.ada, 
                Qualification.unqualified, 
                ItemType.instanceName )
        qualifiedNullName = table.makeName( 
                Format.ada, 
                Qualification.full, 
                ItemType.null_constant )
        template = Template( file=templatesPath()+"delete_specific.func.tmpl" )
        template.procedureHeader = makeDeleteSpecificProcHeader( table, connection_string, ' is' )
        template.primaryKeyCriteria = makePrimaryKeyCriterion( table, 'c' )
        template.assignToNullRecord = instanceName + " := " + qualifiedNullName
        s = str(template) 
        return s
Exemplo n.º 4
0
def makeSaveProcBody( table ):
        instanceName = table.makeName( Format.ada, Qualification.unqualified, ItemType.instanceName )
        outputRecord = table.makeName( Format.ada, Qualification.full, ItemType.table )
        template = Template( file=templatesPath()+"save.func.tmpl" )
        template.procedureHeader = makeSaveProcHeader( table, CONNECTION_STRING, ' is' )
        template.allCriteria = makeCriterionList( table, 'c', 'all', True )
        primaryKey = makePrimaryKeySubmitFields( table )
        # template.tmpVariable = instanceName + "_tmp"
        pkFields = table.getPrimaryKeyVariables()
        template.insertStrings = makeAliasedStrings( instanceName, table.variables )
        template.existsCheck = 'Exists( ' + primaryKey + ' ) then'
        template.updateCall = 'Update( '+ instanceName + ', local_connection )'
        # template.tmpVariableWithAssignment = instanceName + "_tmp : " + outputRecord;
        template.has_pk = table.hasPrimaryKey()
        # template.retrieveByPK = instanceName + '_tmp := retrieve_By_PK( ' + primaryKey + ' )'
        
        template.allParams = makeParamsBindings( instanceName, table.variables )
        s = str(template) 
        return s        
Exemplo n.º 5
0
def makeUpdateProcBody( table ):
        template = Template( file=templatesPath()+"update.func.tmpl" )
        template.procedureHeader = makeUpdateProcHeader( table, CONNECTION_STRING, ' is' )
        template.pkCriteria = makeCriterionList( table, 'pk_c', 'primaryKeyOnly', True )
        template.inputCriteria = makeCriterionList( table, 'values_c', 'allButPrimaryKey', True )
        return str(template)