db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bogdan Vatkov" <bvat...@globaltech-bg.com>
Subject Bug ?
Date Wed, 02 Jun 2004 13:28:42 GMT


Guys,
I think here is a bug:
Pre:

A Primary Key does not tell us that this a field that is going to be created on the Database-server-side.
AFAIK there are 2 ways for this:
1) This is done by creating an Autoincrement column and thus to force the DB server to fill
a value for it.
2) This is done by marking a column as NOT NULL and define DEFAULT value and passing a NULL
value for it int he SQLs

but in the BasePeer.vm we see the following:

/** Build a Criteria object from the data object for this peer */

public static Criteria buildCriteria( $table.JavaName obj )

{

Criteria criteria = new Criteria(DATABASE_NAME);

#foreach ($col in $table.Columns)

#set ( $cfc=$col.JavaName )

#set ( $cup=$col.Name.toUpperCase() )

#if ($col.isPrimaryKey() && !$table.IdMethod.equals("none"))

if (!obj.isNew())

#end

criteria.add($cup, obj.get${cfc}());

#end

return criteria;

}





So we are by-passing all primary keys, shouldn't we by-pass all Autoincrements ?

And this:

#if ($col.isPrimaryKey() && !$table.IdMethod.equals("none"))

To become this:

#if ($col.isAutoIncrement() && !$table.IdMethod.equals("none"))



Regards,

Bogdan


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message