db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/generator/src/templates/ojb/model ExtensionObject.vm Object.vm Control.vm ExtensionInterface.vm ExtensionProxyInterface.vm Interface.vm ProxyInterface.vm
Date Sat, 28 Jun 2003 15:35:42 GMT
mpoeschl    2003/06/28 08:35:42

  Added:       src/generator/src/templates/ojb/model_broken Interface.vm
                        Control.vm ExtensionObject.vm ExtensionInterface.vm
                        ProxyInterface.vm Object.vm
                        ExtensionProxyInterface.vm
  Removed:     src/generator/src/templates/ojb/model ExtensionObject.vm
                        Object.vm Control.vm ExtensionInterface.vm
                        ExtensionProxyInterface.vm Interface.vm
                        ProxyInterface.vm
  Log:
  the ojb model doesn't work .. so i moved the templates to mode_broken
  let's start with a simple but working model
  
  Revision  Changes    Path
  1.1                  db-torque/src/generator/src/templates/ojb/model_broken/Interface.vm
  
  Index: Interface.vm
  ===================================================================
  package ${package};
  
  import java.io.Serializable;
  import java.util.Date;
  import java.math.BigDecimal;
  
  /**
  #if ($addTimeStamp)
   * This interface was autogenerated by Torque on:
   *
   * [$now]
   *
  #end
   * You should not use this interface directly.  It should not even be
   * extended all references should be to ${table.JavaName}Interface
   */
  public interface ${basePrefix}${table.JavaName}Interface extends Serializable
  {
  
      #foreach ($col in $table.Columns)
          #set ( $cfc=$col.JavaName )
          #set ( $cfc=$cfc.replaceFirst(".", $cfc.substring(0,1).toUpperCase()) )
          #set ( $clo=$col.Name.toLowerCase() )
          #set ( $cjtype = $col.JavaPrimitive )
  
       /**
        * Get the $cfc
        * @return $cjtype
        */
       public $cjtype get${cfc}();
  
       /**
        * Set the value of $cfc
        */
       public void set${cfc}($cjtype v );
  
       #end
  
  }
  
  
  
  1.1                  db-torque/src/generator/src/templates/ojb/model_broken/Control.vm
  
  Index: Control.vm
  ===================================================================
  #set ( $basePath = ${generator.OutputPath} )
  
  #foreach ($dataModel in $dataModels)
    #foreach ($database in $dataModel.Databases)
    
      #if ($database.Package)
        #set ($package = $database.Package)   
      #else   
        #set ($package = $targetPackage)
      #end
    
      #set ( $path = $strings.getPackageAsPath($package) )
      $files.mkdir("$outputDirectory/$path")
    
      #foreach ($tbl in $database.Tables)
        $tbl.Name
        #set ( $firstcap=$tbl.JavaName )
        
        #set ( $fname = "${firstcap}.java" )
        #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
  
        #if (!$files.file($basePath,$path).exists())
          $generator.parse("ojb/model/ExtensionObject.vm",$path,"table",$tbl)
        #end
  
        #set ( $fname = "${basePrefix}${firstcap}.java" )
        #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
        $generator.parse("ojb/model/Object.vm",$path,"table",$tbl)
  
        #if ( $ojbUseProxy == true )
   	     
        	#set ( $fname = "${firstcap}ProxyInterface.java" )
         	#set ( $path = "${strings.getPackageAsPath($package)}$fname" )
        	#if (!$files.file($basePath,$path).exists())
        	  $generator.parse("ojb/model/ExtensionProxyInterface.vm",$path,"table",$tbl)
        	#end
  
        	#set ( $fname = "${basePrefix}${firstcap}ProxyInterface.java" )
         	#set ( $path = "${strings.getPackageAsPath($package)}$fname" )
        	$generator.parse("ojb/model/ProxyInterface.vm",$path,"table",$tbl)
        
        #end
  
        #if ($ojbUseInterface == true )
  
          #set ( $fname = "${firstcap}Interface.java" )
          #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
          #if (!$files.file($basePath,$path).exists())
            $generator.parse("ojb/model/ExtensionInterface.vm",$path,"table",$tbl)
          #end	
        
          #set ( $fname = "${basePrefix}${firstcap}Interface.java" )
          #set ( $path = "${strings.getPackageAsPath($package)}$fname" )     
          $generator.parse("ojb/model/Interface.vm",$path,"table",$tbl)
  
        #end
      #end
    #end
  
  #end
  
  
  
  1.1                  db-torque/src/generator/src/templates/ojb/model_broken/ExtensionObject.vm
  
  Index: ExtensionObject.vm
  ===================================================================
  #set ($interface = "")
  #if ($table.Interface)
      #set ($interface = ", $table.Interface")
  #end
  
  package $package;
  
  #if ($table.isAbstract())
      #set ($abstract = "abstract")
  #end
  
  import org.apache.torque.om.Persistent;
  
  /**
  #if ($addTimeStamp)
   * The skeleton for this class was autogenerated by Torque on:
   *
   * [$now]
   *
  #end
   * You should add additional methods to this class to meet the
   * application requirements.  This class will only be generated as
   * long as it does not already exist in the output directory.
   */
  public $!abstract class $table.JavaName
      extends $basePrefix$table.JavaName
      implements ${table.JavaName}Interface
  {
  }
  
  
  
  1.1                  db-torque/src/generator/src/templates/ojb/model_broken/ExtensionInterface.vm
  
  Index: ExtensionInterface.vm
  ===================================================================
  #set ($interface = "")
  #if ($table.Interface)
      #set ($interface = ", $table.Interface")
  #end
  
  package $package;
  
  #if ($table.isAbstract())
      #set ($abstract = "abstract")
  #end
  
  /**
  #if ($addTimeStamp)
   * The skeleton for this interface was autogenerated by Torque on:
   *
   * [$now]
   *
  #end
   * You should add additional methods to this interface to meet the
   * application requirements.  This class will only be generated as
   * long as it does not already exist in the output directory.
   */
  public interface ${table.JavaName}Interface
      extends ${basePrefix}${table.JavaName}Interface
  {
  }
  
  
  
  1.1                  db-torque/src/generator/src/templates/ojb/model_broken/ProxyInterface.vm
  
  Index: ProxyInterface.vm
  ===================================================================
  package ${package};
  
  import java.io.Serializable;
  import java.util.Date;
  
  /**
  #if ($addTimeStamp)
   * This interface was autogenerated by Torque on:
   *
   * [$now]
   *
  #end
   * You should not use this proxy interface directly.  It should
   * not even be extended all references should be to
   * ${table.JavaName}ProxyInterface
   */
  public interface ${basePrefix}${table.JavaName}ProxyInterface extends Serializable
  {
  
      #foreach ($col in $table.PrimaryKey)
          #set ( $cfc=$col.JavaName )
          #set ( $cfc=$cfc.replaceFirst(".", $cfc.substring(0,1).toUpperCase()) )
          #set ( $clo=$col.Name.toLowerCase() )
          #set ( $cjtype = $col.JavaPrimitive )
  
      /**
       * Get the $cfc
       * @return $cjtype
       */
      public $cjtype get${cfc}();
  
      #end
  }
  
  
  
  1.1                  db-torque/src/generator/src/templates/ojb/model_broken/Object.vm
  
  Index: Object.vm
  ===================================================================
  package ${package};
  
  #if ($table.BaseClass)
      #set ($extendsBaseClass = "extends $table.BaseClass" )
  #else
      #set ($extendsBaseClass = "" )
  #end
  
   #if ($table.Interface)
      #if ($ojbUseInterface == true)
      	#set ($interface = "Serializable, ${basePrefix}${table.JavaName}Interface, $table.Interface"
)
      #else
      	#set ($interface = "Serializable, $table.Interface" )
      #end
  #else
      #if ($ojbUseInterface == true)
  	#set ($interface = "Serializable, ${basePrefix}${table.JavaName}Interface" )
      #else
  	#set ($interface = "Serializable" )
      #end
   #end
  
  import java.io.Serializable;
  import java.util.Date;
  import java.math.BigDecimal;
  
  /**
  #if ($addTimeStamp)
   * This class was autogenerated by Torque on:
   *
   * [$now]
   *
  #end
   * You should not use this class directly.  It should not even be
   * extended all references should be to $table.JavaName
   */
  public class ${basePrefix}${table.JavaName} $extendsBaseClass
          implements $interface
  {
  
      #foreach ($col in $table.Columns)
        #set ( $cjtype = $col.JavaPrimitive )
        #set ( $clo=$col.Name.toLowerCase() )
        #set ( $defaultValue = "null" )
        #if ( $cjtype == "boolean")
          #set ( $defaultValue = "false" )
        #elseif ($cjtype == "int")
          #set ( $defaultValue = "0" )
        #end
      private $cjtype $clo = $defaultValue;
      #end
  
      #foreach ($col in $table.Columns)
          #set ( $cfc=$col.JavaName )
          #set ( $cfc=$cfc.replaceFirst(".", $cfc.substring(0,1).toUpperCase()) )
          #set ( $clo=$col.Name.toLowerCase() )
          #set ( $cjtype = $col.JavaPrimitive )
  
      /**
       * Get the $cfc
       * @return $cjtype
       */
      public $cjtype get${cfc}()
      {
          return $clo;
      }
  
      /**
       * Set the value of $cfc
       */
      public void set${cfc}($cjtype v )
      {
          this.$clo = v;
      }
  
      #end
  }
  
  
  
  1.1                  db-torque/src/generator/src/templates/ojb/model_broken/ExtensionProxyInterface.vm
  
  Index: ExtensionProxyInterface.vm
  ===================================================================
  #set ($interface = "")
  #if ($table.Interface)
      #set ($interface = ", $table.Interface")
  #end
  
  package $package;
  
  
  /**
  #if ($addTimeStamp)
   * The skeleton for this interface was autogenerated by Torque on:
   *
   * [$now]
   *
  #end
   * You should add additional methods to this interface to meet the
   * application requirements.  This class will only be generated as
   * long as it does not already exist in the output directory.
   */
  public interface ${table.JavaName}ProxyInterface
      extends ${basePrefix}${table.JavaName}ProxyInterface
  {
  }
  
  
  

Mime
View raw message