Hey there,

I've got a project uses SQLite for integration tests and SQL Server 2008 in
production. In test, I generate the database via the SchemaExport object --
seems like it's a pretty common scenario.

Some of my entities have an ExternalId column, basically a uniqueidentifier
column marked as rowguid in SQL Server. in SQL Server I set the column to
Not NULL and I set the default value to generate a new ID. Then, in my
mappings, I set generated="insert" and everything works very nicely -- I can
see GUIDs coming back from the DB and stuff.

However, this all breaks down in test! My initial solution was to just I set
up an event handler that will look for an ExternalId property and populate
it with a GUID on save, but I had to modify my mappings and stuff to allow
me to insert the record with a GUID. Obviously, this will break down in
production and I'll have to maintain two mapping files which seems extremely
problematic -- I would *really* like to use SQL Servers engine to create the
GUIDs for replication, etc.

Is there any way to perhaps force SQLite to generate rowguids, perhaps a way
to specify default values for columns during the export?

-- 
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.

Reply via email to