Skip to content
Frans Bouma edited this page Jul 3, 2015 · 19 revisions

Welcome to the Massive wiki!

Changes made so far in v2.0

The following (breaking) changes have been made in v2.0 (see 'Refactoring' branch)

  • table.DefaultValue(column) has been removed; it was of no use, the method required a column instance but there was no way to obtain one.
  • table.DefaultValue(string) has been added. string is the name of the column to return the default value for the column with the name specified.
  • (SQL Server) table.DefaultValue(string) returns a DateTime value now if the default value is getdate() or equivalent.
  • (SQL Server) By default, SCOPE_IDENTITY() is used for sequenced fields. If a field should be sequenced using another sequence, e.g. @@IDENTITY, override GetSequenceName() in your DynamicModel-deriving class and return "@@IDENTITY" or the full sequence value retrieval statement (e.g. "NEXT VALUE FOR dbo.MySequence").
  • The DynamicModel constructor now accepts a flag, primaryKeyFieldIsSequenced (default is true), which allows you to specify whether the primary key field is sequenced (it's an identity field, has a sequence) or not (false, so you specify the PK field value at insert). If you set this to false, be aware that you can't bulk-insert using Save(objects), as Save(objects) always creates update queries from objects which have their primary key field set to a value. Instead, use the new SaveAsNew method (see below)
  • DynamicModel.SaveAsNew(params object[]) has been added. This method acts like DynamicModel.Save(params object[]) but creates insert statements for each element, regardless whether it has a pk field set or not. If the PK field is sequenced/identity, the value inserted isn't read back.
Clone this wiki locally