So I am going through the motions of creating my first custom id generator
for an unusual legacy database. It has gone quite smoothly and I managed to
get it all done in a day, however I want to make sure that for my testing
SchemaExecute works and creates the necessary tables for the custom
generator scheme. I am assuming that the relevent methods from
TableGenerator are:
public string[] SqlCreateStrings(Dialect.Dialect dialect)
public string[] SqlDropStrings(Dialect.Dialect dialect)
However these cannot be overridden and even if I hide them with 'new' the
methods in my custom generator are never called. Am I missing something. I
have two tables required by this database. I have treated the counter table
as if it was a hilo table so it is being created automatically when I set
the 'table' and 'column' variables. Then there is a second table with a
seed value that I also need to create. My new methods are as follows:
public new string[] SqlCreateStrings(Dialect dialect)
{
// SQL required to add the Sys_Info table for a new FDP test
database
return new string[]
{
"create table " + "Sys_Info" + " ( SeedCount " +
dialect.GetTypeName(SqlTypeFactory.Int32) + " )",
"insert into " + tableName + " values ( 1 ),"
+ base.SqlCreateStrings(dialect)
};
}
public new string[] SqlDropString(Dialect dialect)
{
return new string[] { dialect.GetDropTableString("Sys_Info") +
"," + base.SqlDropString(dialect) };
}
If someone with a bit more experience with custom generator strategies could
let me know if I am going about this wrong I would very much appreciate it.
Thanks,
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---