db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giulio Vezzelli" <giulio.vezze...@infolog.it>
Subject R: Informix and Torque
Date Tue, 02 Mar 2004 11:05:57 GMT
Thanks Eric!

I'm trying it today.

By the way, do you know anything about Informix's SERIAL type ?

It's a sort of autoincrementing int key. I do not see it being supported by
Torque right now...
Since I need it, if it's missing, I'll have to add support for it!


Giulio Vezzelli
Infolog S.r.l.
Via Alfieri, 28
Modena - 41100
Telefono : +39-059-822446
Sito web : http://www.infolog.it
E-mail : giulio.vezzelli@infolog.it
 
 

> -----Messaggio originale-----
> Da: eric barbe [mailto:ebarbe@deliasystems.com] 
> Inviato: martedì 2 marzo 2004 11.54
> A: Apache Torque Users List
> Oggetto: RE: Informix and Torque
> 
> Sorry...
> 
> columns.vm
> 
> #foreach ($col in $table.Columns)
>     #set ( $type = $dbprops.get($col.Type) )
>     #set ( $size = $col.printSize() )
>     #set ( $default = $col.DefaultSetting )
>     #set ( $nullString = $strings.select($col.isNotNull(),
> $dbprops.get("NOTNULL"),"") )
>     #set ( $entry = "$col.Name $type $size $default $nullString," )
>     $strings.sub($strings.collapseSpaces($entry)," ,",",") #end
> 
> create.vm
> 
> #foreach ($tbl in $database.tables)
> #if (!$tbl.isSkipSql())
> $generator.parse("$basepath/table.vm", $outFile, "table", 
> $tbl) #end #end
> 
> db.props
> 
> BIT = BOOLEAN
> TINYINT = TINYINT
> SMALLINT = SMALLINT
> INTEGER = INTEGER
> BIGINT = BIGINT
> FLOAT = FLOAT
> REAL = REAL
> DOUBLE = FLOAT
> NUMERIC = NUMERIC
> DECIMAL = DECIMAL
> CHAR = CHAR
> VARCHAR = NCHAR
> LONGVARCHAR = LVARCHAR(4000)
> DATE = DATETIME YEAR TO SECOND
> TIME = DATETIME YEAR TO SECOND
> TIMESTAMP = DATETIME YEAR TO SECOND
> BINARY = BINARY(7132)
> VARBINARY = IMAGE
> LONGVARBINARY = IMAGE
> NULL = NULL
> OTHER =
> JAVA_OBJECT =
> DISTINCT =
> STRUCT =
> ARRAY =
> BLOB = IMAGE
> CLOB = TEXT
> REF =
> 
> AUTOINCREMENT = IDENTITY (1,1)
> NOTNULL = NOT NULL
> 
> removeNotNullWithAutoIncrement = false
> suppressDefaults = false
> maxColumnNameLength = 30
> 
> drop.vm
> 
> #set( $max = 0 )
> #foreach( $tbl in $database.tables )
> #set( $max = $max + 1 )
> #end
> #set( $max = $max - 1)
> #foreach( $i in [ $max .. 0 ] )
> #set( $j = 0 )
> #foreach( $tbl in $database.tables )
> #if( $j == $i )
> #if( !$tbl.isSkipSql() )
> $generator.parse("$targetDatabase/droptable.vm", $outFile, 
> "table", $tbl) #end #end #set( $j = $j + 1 ) #end #end
> 
> droptable.vm
> 
> DROP TABLE $table.Name CASCADE;
> 
> foreignkey.vm
> 
> #foreach ($fk in $table.ForeignKeys)
> ALTER TABLE $table.Name
>     ADD CONSTRAINT FOREIGN KEY ($fk.LocalColumnNames)
>     REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames)
>     CONSTRAINT $fk.Name
> #if ($fk.hasOnUpdate())
>     ON UPDATE $fk.OnUpdate
> #end
> #if ($fk.hasOnDelete())
>     ON DELETE $fk.OnDelete
> #end
> ;
> 
> #end
> 
> index.vm
> 
> #foreach ($index in $table.Indices)
> CREATE #if($index.Unique)UNIQUE#end INDEX $index.Name ON 
> $table.Name ($index.ColumnList); #end
> 
> primarykey.vm
> 
> #if ($table.hasPrimaryKey())
>     PRIMARY KEY($table.printPrimaryKey()), #end
> 
> table.vm
> 
> 
> /* 
> --------------------------------------------------------------
> -------- */
> /* $table.Name                                                      */
> /* 
> --------------------------------------------------------------
> -------- */
> 
> CREATE TABLE $table.Name
> (
> #set ( $cols = $generator.parse("$basepath/columns.vm", "", 
> "table", $tbl) ) #set ( $pk = 
> $generator.parse("$basepath/primarykey.vm", "", "table",
> $tbl) )
> #set ( $unique = $generator.parse("$basepath/unique.vm", "", "table",
> $tbl) )
> #if($strings.allEmpty([$pk,$unique]))$strings.chop($cols,1)#el
> se$cols#end
> #if($strings.allEmpty([$unique]) &&
> $pk.length()>0)$strings.chop($pk,2)#else$pk#end
> #if($unique.length()>0)$strings.chop($unique,2)#end
> );
> $generator.parse("$basepath/foreignkey.vm", "", "table", $tbl)
> 
> tablefk.vm
> 
> 
> /* 
> --------------------------------------------------------------
> -------- */
> /* $table.Name                                                      */
> /* 
> --------------------------------------------------------------
> -------- */
> 
> #set ( $fk = $generator.parse("$basepath/foreignkey.vm", "", "table",
> $tbl) )
> #if($fk.length() >0)$fk#end
> 
> 
> unique.vm
> 
> #foreach ($unique in $table.Unices)
>     UNIQUE ($unique.ColumnList),
> #end
> -----Message d'origine-----
> De : eric barbe [mailto:ebarbe@deliasystems.com] Envoyé : 
> mardi 2 mars 2004 11:48 À : Apache Torque Users List Objet : 
> RE: Informix and Torque
> 
> 
> May be this can help you. It works on Informix 9.4 !
> 
> -----Message d'origine-----
> De : Luca Zappa [mailto:luca@lucazappa.com] Envoyé : mardi 2 
> mars 2004 11:06 À : torque-user@db.apache.org Objet : Re: 
> Informix and Torque
> 
> 
> 
> No experience with Informix, but the adapter is included:
> 
> 
> org.apache.torque.adapter.DBInformix
> 
> 
> 
> 
> -----Original Message-----
> From: "Giulio Vezzelli" <giulio.vezzelli@infolog.it>
> Sent: Tuesday, 2. Mar 2004 10:52 +0100
> To: <torque-user@db.apache.org>
> Subject: Informix and Torque
> 
> Someone has experience of running Torque on Informix ?
> 
> I see in Torque's homepage that it should be supported, but I 
> don't see the DB adapter in the code...
> 
> 
> 
> Giulio Vezzelli
> Infolog S.r.l.
> Via Alfieri, 28
> Modena - 41100
> Telefono : +39-059-822446
> Sito web : http://www.infolog.it <"
> target="_blank">http://www.infolog.it/>;
> E-mail : giulio.vezzelli@infolog.it
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message