I guess you want me to send in a attached file. So here is the attached
file.

Location: src\templates\ojb\model\Object.vm

- Viru

Date: Fri, 20 Sep 2002 16:39:14 +0200
From: Martin Poeschl <[EMAIL PROTECTED]>
Subject: patch for ojb-model generation
Content-Type: text/plain; charset=us-ascii; format=flowed


please send a patch

Martin

-----Original Message-----
From: Virender Dogra [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 20, 2002 12:22 PM
To: '[EMAIL PROTECTED]'
Subject: patch for ojb-model generation


When I run the " ojb-model " target, the source-code that is generated
mostly does not compile, unless I change it again like:  initialize the
boolean variables to true/false from the generated null initializations.
initialize the int variables to 0 instead of null  import the Date class

I am not a committer so will need the dev groups help to review and
apply the patch.

So I would like to submit a patch that fixes a few things, though not
all of them. The file is: src\templates\ojb\model\Object.vm

And the changes are:

import java.io.Serializable;
//addition begin (importing this by default even if not required)>>
import java.util.Date; 
// << end addition


// original statements that get patched >>
    #foreach ($col in $table.Columns)
    protected $col.JavaPrimitive $col.Name.toLowerCase() = null;
    #end
    
// patch begin (change the above three lines to the following segment>>

    #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
    protected $cjtype $clo = $defaultValue;
    #end

// << end patch

Thanks,

Attachment: Object.vm
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to