Native SQL queries for value collections fail with NullReferenceException

Description

Value collections can currently not be loaded with Native SQL queries. The current code Native SQL base assumes that collections always are entity collections and throw NullReferenceExceptions otherwise. For more detail see http://groups.google.com/group/nhusers/browse_thread/thread/dd8f056309db144a.

Environment

None

Attachments

4

Activity

Show:

Fabio Maulo 
December 30, 2008 at 10:48 AM

Assertion on
LoadElementCollectionWithCustomLoader
LoadCompositeElementCollectionWithCustomLoader
LoadEntityCollectionWithCustomLoader
are related to the saved instance instead to the reloaded instance (persistentEntity).
I'm reviewing your test before analyze the patch.

Gerke Geurts 
December 18, 2008 at 6:21 AM

Updated both unit tests and source code to verify and implement correct loading of collections using <load-collection> and insure backwards compatibility with native SQL queries that returns scalars only.

Gerke Geurts 
December 17, 2008 at 2:34 PM

The submitted patch so far does work for <return-join> of component collections, but not (yet) for <load-collection> of component collections. I will submit unit tests and a new patch to add <load-collection> support when available.

Fabio Maulo 
December 17, 2008 at 6:52 AM

I will review your test and patch.

Gerke Geurts 
December 17, 2008 at 6:32 AM

Added patch that addresses all issues in NH-1612-Test.patch and that have been tested against all existing tests in NHibernate.Test.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created December 15, 2008 at 7:26 PM
Updated July 22, 2009 at 7:21 AM
Resolved January 3, 2009 at 9:43 AM
Who's Looking?