home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
ne_serial.tcl
< prev
next >
Wrap
Text File
|
1997-06-04
|
2KB
|
67 lines
#---------------------------------------------------------------------------
#
# Copyright (c) 1995 by Cayenne Software Inc.
#
# This software is furnished under a license and may be used only in
# accordance with the terms of such license and with the inclusion of
# the above copyright notice. This software or any other copies thereof
# may not be provided or otherwise made available to any other person.
# No title to and ownership of the software is hereby transferred.
#
# The information in this software is subject to change without notice
# and should not be construed as a commitment by Cayenne Software Inc.
#
#---------------------------------------------------------------------------
#
# File : @(#)ne_serial.tcl /main/hindenburg/3
# Original date : 31-01-1995
# Description : procedure to support the serial data type
#
#---------------------------------------------------------------------------
#
# @(#)ne_serial.tcl /main/hindenburg/3 4 Jun 1997 Copyright 1995 Cayenne Software Inc.
#
#---------------------------------------------------------------------------
# find the serial column nr
#
proc get_serial_column_nr {table} {
foreach col [$table columnSet] {
set col_type [get_table_type $col]
if [is_serial $col_type] {
return [get_column_nr $col]
}
}
return 0
}
# update the data field which is a serial in the base class
#
proc call_for_all_bases_set_serial {class sect} {
set gen_nodes [$class genNodeSet]
if [lempty $gen_nodes] {
return
}
set class_data [uncap [$class getName]]Data
set class_serial_nr [get_serial_column_nr [$class table]]
$sect indent +
foreach gen_node $gen_nodes {
set superClass [$gen_node superClass]
if ![$superClass isPersistent] {
continue
}
set table [$superClass table]
set serial_nr [get_serial_column_nr $table]
if {$serial_nr == 0} {
continue
}
set name [$gen_node getSuperClassName]
set super_data [uncap $name]Data
expand_text $sect {
CALL ~$class_data.getVal(~$class_serial_nr).setValueStr(
~$name::~$super_data.getVal(~$serial_nr).getValueStr())
}
}
$sect indent -
}