Donate Share

DomainObjects for .NET

Project News for DomainObjects for .NET

  • DomainObjects for .NET 3.5 v2.1.0 Released

    Release 2.1.0 (April 26, 2009)

    NOTE: This version of DomainObjects has been extensively tested against
    SQL Server 2005, but not against Oracle or MySQL.

    - New: Enabled adding a relationship to multiple times to a class.
    See unit test ChangeReferenceToAndSelectField().

    - New: Changed accessibility of some methods/properties from internal to public
    to support dynamic generation of criteria and queries.

    - New: Enabled adding a relationship multiple times to a class.
    See unit test ChangeReferenceTo().

    - New: Added ability to serialize/deserialize the GetDate, Plus and
    Minus functions to/from a string.

    - New: Added the Minus function and overloaded the Field '-' operator.

    - New: Added support for serialization and deserialization of a Field to
    and from a string. See the unit tests in the #region
    'Field Serialization Tests' in the test fixture SerializationTests.

    - New: Created Sandcastle project. May replace NDoc with Sandcastle as
    Sandcastle is actively supported and used by Microsoft.

    - New: Added support for multi-column primary keys containing a mixture of
    auto incremented and non-auto incremented columns.

    - New: Improved support of partitioned tables.

    - New: Added ability to specify a SQL Server OPTIMIZE FOR query hint.
    See the QueryHintTests test fixture for usage examples.

    - New: The methods Criteria.AddEqualTo(), AddGreaterThan(), AddLessThan(),
    AddGreaterOrEqualThan(), AddLessOrEqualThan() now can accept either Fields
    or value types as the comparison argument. AddEqualToField(),
    AddGreaterThanField(), et. al., have been removed from the API.

    - New: Implemented support for type-safe common table expressions.
    See TableExpressionTests test fixture for usage examples.

    - New: Added support for the SQL Server ROW_NUMBER clause. See the unit test
    RowNumber() for a usage example.

    - New: Added support for M:N relationships where the related tables have
    multi-column primary keys.

    - Fix: Issue with serializing a Query.

    - Fix: Null reference exception when comparing a FieldValue with a literal null.

    - Fix: Issue with deserialization of GetDate() function. Should be
    case-insensitive.

    - Fix: Issue where relationship was being initialized even when the
    AttributeDescriptor was marked with DeclaredInBaseClass='true'.

    - Fix: Fixed issues with table expressions.

    - Fix: Fixed issue when equal subqueries are added to another query.

    - Fix: Issues with translating the object model expression into a data
    model expression.

    - Fix: Issue with handling peer subqueries.

    - Fix: When alias is specified in select list but not in the order by.
    See unit test AliasedFieldInSelectListAndFieldInOrderBy().

    - Fix: When multiple relationships in a prefetch have null values or empty
    collections.

    - Internal: Ensured that the result of translating a query to a
    DbModelSelectStatement will not be replaced by subsequent,
    equal queries.

    - Internal: Improved performance of searching for a ReferenceDescriptor in a
    ClassDescriptor by foreign key field id.

    - Internal: Made more extensive use of visitor pattern to recurse the object
    model expression tree to produce the database model expression tree.

    - Internal: Improve performance of binding related objects during cascade
    store/delete.

    - Internal: removed unnecessary list type specification from ObjectSetBuilder

    - Internal: improved performance by caching hashcode value of AttributeDescriptor.

    - Internal: Improved performance of translating object model to database model.

    - Internal: Loading objects from a data table retains the primary key value so
    that data is not lost.

    - Internal: Renamed MultipleCriteriaType to Conjunction

    2009-04-26 22:05:55 UTC by rbeauchamp

  • DomainObjects for .NET 3.5 v2.0.0 Released

    NOTE: This version of DomainObjects has been extensively tested against
    SQL Server 2005, but not against Oracle or MySQL.

    - New: Only fields that have been modified get written to the database in an
    UPDATE statement. See unit test OnlyModifiedFieldsGetWrittenToDatabase().
    If no fields are modified in an object, then an UPDATE statement is not
    generated for that object.

    - New: Overloaded && and || for Criteria. For usage examples, see unit
    tests CriteriaOperatorAnd(), CriteriaOperatorOr(), CriteriaOperatorNesting()
    and CriteriaOperatorPrecedence().

    - New: Overloaded ==, !=, >, <, >=, and <= for FieldValues. For usage examples,
    see unit tests in the test fixture FieldValueTests.

    - New: Added ability to enable identity insert for an InsertByQuery statement.
    See unit test SetIdentityInsertOn() for a usage example.

    - New: Added ability to specify that DomainObjects will compare the value of a
    field before the containing object was modified with the value of the
    field after it was modified to determine whether the containing object
    requires an UPDATE statement to the database. The default value is true.
    See unit test SpecifyThatFieldShouldNotBeUsedToDetermineUpdate().

    - New: Added ability to specify in the Repository.xml that a field should
    always be updated to the database if the containing object is edited even
    if DomainObjects does not determine that it has been modified. The new
    FieldDescriptor attribute that enables this is 'AlwaysUpdate'. See unit
    test UpdateObjectThatContainsInternalPassByReferenceType().

    - New: Added ability to use a scalar subquery in a SQL statement. For usage
    examples see unit tests QueryTests.ScalarSubqueryInWhereClause() and
    QueryTests.ScalarSubqueryInSelectClause().

    - New: Added ability to build an object set from an externally-supplied
    datareader (e.g., from a DataTable). For a usage example, see the unit
    test ObjectBuilderTests.GetObjectSet()

    - New: Added ability to create and execute a 'delete by criteria' which allows
    rows to be deleted in a batch manner directly in the database. See the
    test fixture DeleteByCriteriaTests for usage examples.

    - New: Added ability to specify the command timeout on a per statement basis.
    The default command timeout is the app settings 'CommandTimeout' value.

    - New: Implemented the Min function which returns the minimum value of a field.
    See the unit test FunctionTests.Min() for a usage example.

    - New: Implemented the Replace function which replaces all occurrences of a
    specified string value with another string value. See the unit test
    FunctionTests.Replace() for a usage example.

    - New: Added the Plus function. Applies the plus operator to two values.
    The resulting expression has the form 'value1 + value2'. In SQL, sometimes
    this results in a string concatenation, and sometimes this results in the
    sum of the two values. Also overloaded the + operator on the Field class
    so that fields and strings can be concatenated using a natural SQL-syntax.
    See the unit test FunctionTests.Concat() for a usage example.

    - New: Added ability to retrieve an enumerable collection of DataRows from the
    database such that LINQ queries can be executed against the result set.
    See the unit test FunctionTests.Concat() for a usage example.

    - New: Added support for computed columns. Added FieldDescriptor attribute of
    'IsComputed' to specify that the value of the field is derived from a
    computed column in the database. Validated via the unit tests
    InsertWithComputedColumn() and UpdateWithComputedColumn().

    - New: Added support for Visual Studio 2008 and .NET 3.5.

    - New: Added support for double Primary Keys

    - Bug fix: Removed caching of non-readonly objects.

    - Bug fix: Removed sql parameter caching because it is problematic.

    - Bug fix: Improved reliability reaching every node of an object model.
    (Some bugs exist where if expressions in an object model are nested
    in a certain way, they do not get reached.)

    - Bug fix: Some classes need the Serializable attribute if you need to serialize
    a criteria with a subquery criteria

    - Bug fix: The Count.GetToStringValue was wrong. See test
    FunctionTest.GetCountToStringTest

    - Bug fix: Bugfixes using the new features against Oracle

    - Bug fix: The ToString of ComparisonCriteria class fails if it has only an
    operator. See NullCriteriaToStringTest

    - Bug fix: Fixed issue with SQL generation of constants.

    - Bug fix: Fixed issue when query is assigned a null criteria: the search
    concrete type was not being constrained.

    - Bug fix: Fixed problem where only unique items were being added to the
    select list.

    - Bug fix: Fixed issues with order by and group by in a scalar subquery.

    - Bug fix: Fixed issue where the VersionNumber of an object was being updated
    when the object was not actually modified and written to the
    database. See unit test VersionNumberShouldNotBeIncrementedIfObjectNotActuallyUpdatedToDatabase().

    - Bug fix: Validated that updates can occur to non-loaded proxied objects
    within a transaction without throwing an error.

    - Bug fix: Fixed problem with referencing subtypes in a prefetch path.

    - Internal: Now using the visitor pattern to recursively walk the DomainObjects
    object model expression tree and translate it to a database model
    expression tree.

    - Internal: Improved the reliability of visiting all nodes in a object model
    expression tree.

    - Internal: Improved performance of visiting the nodes in a object model
    expression tree.

    - Internal: Moved from using the DomainObjects ImmutableList to LINQ.

    2008-10-24 14:52:32 UTC by rbeauchamp

  • DomainObjects for .NET 2 v1.5 Released

    - Implemented ability to specify an EXISTS or NOT EXISTS clause in via
    Criteria.AddExists() and Criteria.AddNotExists(). For usage examples,
    see the unit tests in CriteriaTests: AddExistsViaSubquery(),
    AddNotExistsViaSubquery(), AddExistsViaCriteria(), AddNotExistsViaCriteria().

    - Implemented ability to create a correlated subquery. For usage examples,
    see the unit tests in CorrelatedSubqueryTests.

    - Implemented the DateAdd function. See FunctionTests.DateAdd() for a
    usage example.

    - The Lower and the Upper function name now depends on the
    DataProvider/AbstractDataProvider.cs

    - Some of the unit test's categories were changed in order to ease the testing
    on Oracle. NUnit tests against Oracle should ignore the DoesNotWorkWithOracle
    category.

    - The accessibility of Criteria.ConvertToSearchConditionClauseText() was changed
    beacause the external providers need access to it.

    - Now the DataProvider has the responsibility of building a Case, Upper and
    Lower function

    - DomainObjects now correctly creates aliases based on relationships to
    subclasses in a query. See the unit test
    QueryTests.ConstrainQueryOnDifferentRelatedSubClasses().

    - Bug fix: The TableAlias must not have a length greater than 30 in Oracle.

    - Bug fix: with statement generation when sub types are specified in the beginning
    of a reference path.

    - Bug fix: where the SetParameter was not correctly handling a Field set value.

    - EnumStringConversion now handles null input values.

    - Big fix: where an 'unable to cast transparent proxy' exception would be
    thrown because hash codes were not unique across different RelationshipIdentity
    instances.

    - Implemented the SQL Server Convert function. For a usage example see
    http://domainobjects.sourceforge.net/Documentation/Api/SourceHtml/FunctionTests.cs.html#l_515

    - Bug fix: The RelationshipIdentity was generating the same hash code for almost
    equal references.

    - Bug fix: the left side of a comparison criteria was not being parameterized.
    See unit test FunctionTests.DateDiffWithDateAdd().

    - New interface called IExecutionAware. This interface allows a persistable
    object to receive callbacks from DomainObjects when it attempts to execute
    a sentence to persist the object. This interfaces has the following methods:
    BeforeExecuteAllSentences, AfterExecuteAllSentences, BeforeExecute,
    AfterExecute.

    - New method in the IExecutionAware called AfterExecuteAndCommit. This method
    is called after the commit to database was made but before closing the
    connection.

    - The DatabaseSession raises a new event called AfterExecuteEvent. This event
    is very similiar to DatabaseAccessEvent but this event assures that the
    connection is available. This event its very important when the user works
    with DBLink in Oracle. The user must close all the DBLinks using the same
    connection after the DBLink is used.
    See http://www.freelists.org/archives/oracle-l/11-2004/msg00238.html

    - Improved performance by caching frequently accessed data in the
    ClassDescriptor.

    - Bug fix: queries were being executed when transaction was committing.

    - Bug fix: with deleted items not being removed from relationship after
    transaction commit.

    - Code cleanup and optimization from Resharper 3.0 static code analysis.

    - The exception thrown by the GetClassDescriptor was fixed. It threw an
    "Key not found" instead of "{0} not found".

    - Bug fix: with not closing database connections when performing a query for
    a DataSet and executing a GetCount.

    - Changed the way DomainObjects constrains types in a SQL statement so that the
    SQL statement is more performant: If the SQL statement contains an inner join
    that is unique to the particular type, i.e., it is not in the base class, then
    this is sufficient to constrain the type; the 'IN' clause is not necessary.
    See the unit test ConcreteTypeConstraintsNotAddedToQueryWhenQueryContainsInnerJoinUniqueToType().

    - Bug fix: with constraining type if SQL statement contains inner join unique
    to that type. See unit test INClauseAddedWhenInnerJoinIsNotUniqueToType().

    - Added precondition checks to ensure that compare-to-values are valid before
    creating a criteria.

    - Bug fix: so that the starting class of a relationship path can reference
    its sub class. See unit test
    GeneratedReferencePathTests.RootOfPathAllowsSubClasses().

    - Added unit test called SameColumnFieldWithDifferentPathHasDifferentToStringValue().

    - Improved the Debug output of DomainObject Fields.

    - Upgraded to v2.4.2 of NUnit

    - Added ability to serialize a PersistableObject via XmlSerializer.
    See unit test XmlSerializePersistableObject().

    - Bug fix: where nested subqueries would not get initialized, resulting in
    a KeyNotFoundException. Fix is validated via the unit test
    QueryTests.InNestedSubQuery().

    - Bug fix: Dirty objects were cached after aborted transaction. All the modified
    objects are removed after an aborted transaction.

    - Added ability to assign an update value of type Field within an
    UpdateByCriteria. See unit test
    UpdateByCriteriaTests.UpdateByCriteriaWithCase().

    - Simplified the default UnitTestProperties.xml settings so that a new user can
    run the tests, preferably, without having to override any values.

    - Bug fix: where if a base class and a subclass were both at the beginning
    of a reference path, the sub class may not be correctly constrained in a query.
    See unit test GeneratedReferencePathTests.SubClassAtRootOfPathCorrectlyConstrained().

    - Simplified the creation of a subclass relationship in a reference path.

    - Bug fix: where the complete set of parameters in an insert or update
    statement were not being created.

    - Bug fix: where parameters created for a SQL statement were not being used.

    - Bug fix: where DomainObjects references and collections were retaining a
    reference to the identity of objects involved in an aborted transaction.

    - Bug fix: where a byte array could not be assigned as a parameter value.

    - Simplified the unit test configuration so that the first-time user can easily
    run the unit tests.

    - Started implementation to support Access 2000.

    - The property SupportsBatchExecution were added in the DataProvider classes
    because Access does not support an insert and the select looking for the Id
    created in the same execution batch

    2007-10-30 04:18:51 UTC by rbeauchamp

  • DomainObjects for .NET 2 v1.1.2 Released

    - Implemented support for implicit conversion between a VARCHAR in the
    database and a nullable enum in the middle tier.

    - Implemented support for specifying a nullable type in the Repository.xml
    file using the '?' notation. See the 'SecondCategory' FieldDescriptor in
    the DomainObjects Repository.xml file for a usage example.
    See http://domainobjects.sourceforge.net/Documentation/Api/SourceHtml/NullableTypesTests.cs.html#l_83

    - Fixed issues and improved performance of DomainObjects collections.

    - Removed code that was automatically binding an object to the current
    transaction when it was proxied. The user may not want the proxied
    object bound to the transaction.

    - Added ability to cache and retrieve a Field by key.
    See http://domainobjects.sourceforge.net/Documentation/Api/DomainObjects.Facade.Command.Expression.Field.GetKey.html

    - Added UpdateByCriteria.Top to generate an 'UPDATE TOP()' SQL statement
    from an UpdateByCriteria.
    See http://domainobjects.sourceforge.net/Documentation/Api/DomainObjects.Facade.Command.UpdateByCriteria.Top.html

    - Added DomainObjectsTestFixture.GetUniqueString() to generate unique unit
    test strings so that tests can be run multiple times against the same
    unit test database without interfering with each other (e.g., because of
    unique key constraints...)

    - Implemented ability to return the count of object set instances or data
    set rows that would be returned by a query.
    See http://domainobjects.sourceforge.net/Documentation/Api/DomainObjects.Facade.Command.Query%601.GetObjectSetCount.html
    and http://domainobjects.sourceforge.net/Documentation/Api/DomainObjects.Facade.Command.Query%601.GetDataSetCount.html

    - Implemented Query.Exists()
    See http://domainobjects.sourceforge.net/Documentation/Api/DomainObjects.Facade.Command.Query%601.Exists.html

    - Updated support for MySql (using the .NET 2.0 adapter).

    - Started building Bank of Davis sample application.

    - Added support to Int64 primary keys, bigint identity columns now
    are supported.

    - Added support to union queries in Oracle.

    - The CompleteCriteriaList, OrderByFieldList and GroupByFieldList properties
    of the Criteria class now are public, so the developer can check if some
    criteria, group by or order by field were added or not.

    - Removed Type parameter from Criteria.AddInSubquery as it can be derived.
    See http://domainobjects.sourceforge.net/Documentation/Api/DomainObjects.Facade.Command.Criteria.AddInSubquery_overloads.html

    - Better encapsulating/hiding internal methods by changing IField to an
    abstract class.

    - Moved Criteria.NO_MAXIMUM_COUNT to the Query class as it makes more
    sense there.

    - Oracle compatible: The field order in the where clause were changed
    (the id field is in the right side of the equality)

    - The SelectFields property of the Query class now is public so the developer
    can check which field were added.

    - The InSubqueryCriteria now is public an this class exposes the ObjectType so
    the developer can check which InSubQueryCriteria is in a criteria class

    - Added ability to 'LeftOuterJoin' a sub class in a reference path. This means
    that the row will be included in the joined rows whether or not the row is an
    instance of the sub class. See the unit test QueryTests.LeftOuterJoinSubClass()
    for an explanation.
    See http://domainobjects.sourceforge.net/Documentation/Api/SourceHtml/QueryTests.cs.html#l_785

    2007-03-15 15:47:36 UTC by rbeauchamp

  • DomainObjects for .NET 2 v1.1.1 Released

    Release 1.1.1 (December 17, 2006)

    - Added ability to 'batch' insert your domain objects directly to the database via a select subquery.
    At runtime DomainObjects generates a INSERT INTO...SELECT statement.
    See the http://domainobjects.sourceforge.net/Documentation/Api/DomainObjects.Facade.Command.InsertByQuery`2.html for an explanation
    and http://domainobjects.sourceforge.net/Documentation/Api/SourceHtml/InsertByQueryTests.cs.html#l_8 for a code example.

    2006-12-17 09:19:16 UTC by rbeauchamp