#set ($basePath = $generator.OutputPath)

#foreach ($dataModel in $dataModels)

  #foreach ($database in $dataModel.Databases)

    #set ( $path = $strings.getPackageAsPath( $omAgentPackage ) )
    $files.mkdir("$outputDirectory/$path")

    #set ( $path = $strings.getPackageAsPath( $omAgentImplPackage ) )
    $files.mkdir("$outputDirectory/$path")

    #foreach ($tbl in $database.Tables)
    
      #if (!$tbl.isForReferenceOnly())
        $tbl.Name
        #set ( $firstcap=$tbl.JavaName )

        #set ( $fname = "${firstcap}Agent.java" )
        #set ( $path = "${strings.getPackageAsPath( $omAgentPackage )}$fname" )
        ##if (!$files.file($basePath,$path).exists())
          $generator.parse("om/agent/agentInterface.vm",$path,"table",$tbl)
        ##end

        #set ( $fname = "${firstcap}AgentImpl.java" )
        #set ( $path = "${strings.getPackageAsPath( $omAgentImplPackage )}$fname" )
        ##if (!$files.file($basePath,$path).exists())
          $generator.parse("om/agent/agentImpl.vm",$path,"table",$tbl)
        ##end

      #end
    #end
    
  #end
#end

#set ( $fname = "agent.dicon" )
#set ( $path = "${strings.getPackageAsPath($omAgentPackage)}$fname" )
##if (!$files.file($basePath,$path).exists())
  $generator.parse("om/agent/agent_dicon.vm",$path)
##end
