Hi all,
First, let me say that I recognize that I'm skipping over most of what is asked for in the new topic template. The application that I'm working on is fairly complex, and I haven't made a smaller version to show off the problem. I can do that if necessary, but I wanted to see if I could get a pointer in the right direction first.
The basics of my issue are this: in my application, we take snapshots of data when key events happen. Depending on the event, the snapshot may be 'sparsely populated' or not. These snapshots are then saved into the database in a separate table, which has an auto-generated identity column. I have the saving and retrieving of the object from the stored table working fine, but as I go to hook in to the two stored procedures, I run into some trouble.
The first bit of trouble is that when I load it from the stored procedure, I don't have an ID. To work around this, I return a fake id from the stored procedure, and then evict it from the session afterwards. This seems a little hackish, but it works for me. If there's a good place for me to investigate about how to make NHibernate not care about the Id for reads, I'd be much obliged.
The second issue that I've run into is that the second stored procedure I use returns only a partial set of the data (with the rest being nulls in the object in question). When I try to use NHibernate to do the mapping for this finder, it generates an index out of range exception for the first of the fields that is not present in the result set. Is there a way I can configure NHibernate to leave properties which are not present in the result set as null? The difference between the two stored procedures is about 30 fields, and modifying the stored procedure to return them feels wrong.
Thanks in advance,
--Wes
Hibernate version:
1.2.0.4000
Name and version of the database you are using:
Sql Server 2000
|