Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30981
Modified Files:
IncrementGenerator.cs
Log Message:
Fixed many small problems with incrementgenerator - code can compile now.
Index: IncrementGenerator.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IncrementGenerator.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IncrementGenerator.cs 6 Apr 2004 00:53:20 -0000 1.1
--- IncrementGenerator.cs 6 Apr 2004 08:48:23 -0000 1.2
***************
*** 6,9 ****
--- 6,11 ----
using NHibernate.Dialect;
using NHibernate.Engine;
+ using NHibernate.Type;
+ using NHibernate.Util;
namespace NHibernate.Id
***************
*** 56,66 ****
public void Configure(IType type, System.Collections.IDictionary parms, Dialect.Dialect d)
{
! string table = parms["table"];
! if(table==null) table = parms[IncrementGenerator.Table);
! string column = parms["column"];
! if(column==null) parms[IncrementGenerator.PK];
! string schema = parms[IncrementGenerator.Schema];
sql = "select max(" + column + ") from " + ( schema==null ? table : schema + ":" + table );
--- 58,66 ----
public void Configure(IType type, System.Collections.IDictionary parms, Dialect.Dialect d)
{
! string table = PropertiesHelper.GetString("table", parms, (string)parms[IncrementGenerator.Table]);
! string column = PropertiesHelper.GetString("column", parms, (string)parms[IncrementGenerator.PK]);
! string schema = (string) parms[Schema];
sql = "select max(" + column + ") from " + ( schema==null ? table : schema + ":" + table );
***************
*** 86,90 ****
if(rs.Read())
{
! next = rs[0] + 1;
}
else
--- 86,90 ----
if(rs.Read())
{
! next = rs.GetInt64(0) + 1;
}
else
|