NHibernate 2.0
Well, here comes NHibernate 2.0!
Downloading from SourceForge:
http://sourceforge.net/project/showfiles.php?group_id=73818')
Details without translation (many letters of niasilil):
New features:- Add join mapping
- <union> tables and <union-subclass> inheritance strategy
- HQL functions 'current_timestamp', 'str' and 'locate' for PostgreSQL dialect
- VetoInterceptor - Cancel Calls to Delete, Update, Insert via the IInterceptor Interface
- Using constants in select clause of HQL
- Added [Table per subclass, using a discriminator] Support to Nhibernate
- Added support for paging in sub queries.
- Auto discovery of types in custom SQL queries
- Added OnPreLoad & OnPostLoad Lifecycle Events
- Added ThreadStaticSessionContext
- Added <on-delete> tag to <key>
- Added foreign-key = "none" since the Parent have not-found = "ignore". (not relevant to SQL Server)
- Added DetachedQuery
- ExecuteUpdate support for native SQL queries
- From Hibernate:
Breaking changes:- Changed NHibernate.Expression namespace to NHibernate.Criterion
- Changed NHiberante.Property namespace to NHiberante.Properties
- There is no need to read or write data.
- <nhibernate> section is ignored, using <hibernate-configuration> section (note that they have different XML formats)
- Configuration values are no longer prefixed by "hibernate.", If you specify just "dialect"
- IInterceptor changed to match the Hibernate 3.2 Interceptor - interface changed
- If there is no validity.
- NHibernate will return long for count (*) queries on SQL Server
- SaveOrUpdateCopy return a new instance of the entity without change the original.
- INamingStrategy interface changed
- NHibernate.Search - Moved Index / Store attributes to the Attributes namespace
- Changes to IType, IEntityPersister, IVersionType - NHibernate.
- <formula> must contain parenthesis when needed
- IBatcher interface change
Fixed bugs:- Fixing bug with HQL queries on map with formula.
- Fixed when the <idbag> has a <composite-element> inside; inside which has a <many-to-one>
- Multi criteria doesn’t support limiting the query size using SQL.
- Fixed issue of MsSql2005 dialect sorting incorrectly on machines with multiple processors
- Fixed an issue with getting NullReferenceException when using SimpleSubqueryExpression within another subexpression
- Fixed Null Reference Exception when deleting a <list> that has holes in it.
- Fixed duplicate column joints of similar tables
- Fixed MultiQuery
- Fixed concat function with a parameter contains a comma, and using MaxResults
- Fixed failure with Formula when using the MSSQL 2005 dialect
- Fixed PersistentEnumType incorrectly assumes types have zero-value defined
- Fixed SetMaxResults () returns one less row when SetFirstResult () is not used
- Fixed Bug in GetLimitString for SQL Server 2005 when ordering by aggregates
- Fixed SessionImpl.EnableFilter returns wrong filter if already enabled
- Fixed Generated Id Does Not Work For MySQL
- Fixed one-to-one can never be lazy
- Fixed FOR UPDATE statements not generated for pessimistic locking
Improvements:- Added Guid support for Postgre Dialect
- Added support for comments in queries
- Added Merge and Persist to ISession
- Support IFF for SQL Server
- IdBag now work with Identity columns
- Multi Criteria now uses the Result Transformer
- Handling key-many-to-one && not-found
- Can now specify that a class is abstract in the mapping.
Guidance:- Preferred use for defining Criteria queries.
Child projects:- Added NHibernate.Validator
- Added NHibernate.Shards
- NHibernate.Search updated match to Hibernate Search 3.0
Criteria API:- Allow Inspection, Traversal, Cloning and Transformation for ICriteria and DetachedCriteria
- Added DetachedCriteria.For <T>
- Added Multi Criteria
- Projections can be passed the SQL statement.
- Added support for calling Sql Functions (HQL concept) from projections (Criteria).
- Added ConstantProjection
- Added CastProjection
- Can be used as parameter to ICriterion
Better validation for proxies:- Now supports checking for fields
- Updated Castle.DynamicProxy2.dll to have better support for .NET 2.0 SP1
SQL Lite:- Support for multi query and multi criteria
- Supporting subselects and limits
- Allowed DROP TABLE IF EXISTS semantics
PostgreSQL (Npgsql):- Enable Multi Query support for PostgreSQL
FireBird:- Much better overall support
Batching:- Changed it out.
- AbstractBatcher before it preparation
Error handling:- Better error message in exception values in Int32Type
- This is a subquery that contains a reference to non existing property.
- Throwing of a unique meaningful exception when calling
- Overall better error handling
- Better debug logs
Refactoring:- Major refactoring internally to use generic collections instead of the non generic types.
- Major refactoring to hbm files.
Factories:- Added ProxyFactoryFactory
- Added BatchingBatcherFactory
Source: https://habr.com/ru/post/38172/
All Articles