When doing a schema export using NHibernate.JetDriver the script comes out wrong
Description
Environment
Attachments
Activity

Hadi Eskandari July 21, 2009 at 1:45 AM
The task is closed along with NHCD25. Natively generated identity columns are mapped to COUNTER column type.

Maggie Longshore (MagPlusPlus) June 3, 2009 at 6:50 AM
Hadi,
I do not know the number of the issue this fixes but it fixes the setting of the parameter sizes.
When I remember why I applied it I will send you a test for it.
Maggie

Maggie Longshore (MagPlusPlus) June 3, 2009 at 6:25 AM
This patch is against version 892 and fixes the $1 error (should be letter L not number 1) and fixes the counter fudge code.

Maggie Longshore (MagPlusPlus) April 26, 2009 at 9:11 PM
I have a fix that removes the INT!!! REPLACE stuff - I am using Access 2007 so I do not have a way to verify the fix works for earlier versions - it should though.
Basically there is a missing override method in the jetdialect
This method in NHibernate 2.0 checks to see if a datatype is needed for the identity key. The default is true but it needs to be false for JetDialect.
in Dialect.cs (NH):
/// <summary>
/// Whether this dialect has an identity clause added to the data type or a
/// completely seperate identity data type.
/// </summary>
public virtual bool HasDataTypeInIdentityColumn
{
get { return true; }
}
needs to be added to jetDialect as:
/// <summary>
/// Whether this dialect has an identity clause added to the data type or a
/// completely seperate identity data type.
/// </summary>
public override bool HasDataTypeInIdentityColumn
{
get { return false; }
}
Then implementation of
public override string IdentityColumnString
{
get { return JetDbCommand.IdentitySpecPlaceHolder; }
}
needs to be changed to
get { return "COUNTER";}
Finally the JetDbCommand.cs can have the substitue string call removed.
A side effect of this fix is that the schema file is formatted nicely when calling SchemaExport
I am making more changes to my version as I need to adjust a few things for FluentNHibernate AutoMapping to work the way I need it to.
When I have completed it I will see if it should be submitted as a patch.

Maggie Longshore (MagPlusPlus) April 21, 2009 at 12:12 PM
It would be better to get rid of the placeholder hack - but I don't know nhibernate well enough to see if possible.
Details
Details
Assignee

Reporter

Example schema export:
create table [FieldValue] (Id INT !!! REPLACE THE PRECEEDING 'INT' AND
THIS PLACEHOLDER WITH 'COUNTER' !!!, Answer TEXT($1) null, Question
TEXT($1) null, Signup_id INT null, primary key (Id))
It seems the placeholders and not getting replaced.