db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Will Holcomb <w...@himinbi.org>
Subject [SOURCE] Issue #TRQS99 - Error setting default on foreign key
Date Wed, 18 Dec 2002 04:31:16 GMT
You can view the issue detail at the following URL:

Type :        Patch
Issue Id :    TRQS99
Reported by: Will Holcomb
             wholcomb - (will@himinbi.org)


Platform: PC
Operating system: Redhat
Summary: Error setting default on foreign key
Description: Object.vm includes the following code in the Object generation code when generating
the methods to set a foreign key reference:

  #set ($coldefval = "0")
  #set ($coldefval = $column.DefaultValue)

The template is checking here if the column being referred to is represented by an object
and choosing how to set the default.

It is setting the default on the local column though, so the check should be whether the local
column is an object, not the reffered to column.

The bulk of this patch is a change to this:

  #set( $defaultValue = 0 )
  ## Velocity will not assign when the returned value is null
  #set( $defaultValue = $column.defaultValue )

There is also some variable renaming within the local code block to make the logic clearer.
(I did it while I was figuring out how it worked.)
Status: New
Priority: Medium
Vote: Medium

View raw message