Mapping-by-Code does not allow UnsavedValue in ComponentAsId mapping

Description

At the moment, it is not possible to set the <composite-id unsaved-value="x"> via mapping-by-code.

Environment

None

Activity

Show:

Alex Zaytsev 
May 1, 2017 at 3:42 AM

Closing issues resolved in 4.1.0

Alex Zaytsev 
September 21, 2014 at 2:02 PM

Merged in 4b88cc128d58abc68d9a3355183adada49d3bd1c

Ricardo Peres 
September 7, 2014 at 7:52 PM

Ricardo Peres 
September 7, 2014 at 2:18 PM

You are right, sorry. I will try to submit a pull request.

Oskar Berggren 
September 7, 2014 at 1:08 PM

I don't think this is a duplicate - I don't see where this is implemented for ComponentAsId().

I'm not sure it makes sense for ComponentAsId() though. In section '7.4. Components as composite identifiers' of the NHibernate referecence, there is written:

"Since a composite identifier must be assigned to the object before saving it, we can't use unsaved-value of the identifier to distinguish between newly instantiated instances and instances saved in a previous session. "

However, ComposedId() should allow setting unsaved-value to 'none' or 'any' as available in the XML mappings, and this feature seems to be missing from mapping-by-code.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created February 4, 2012 at 1:46 PM
Updated May 1, 2017 at 3:42 AM
Resolved September 21, 2014 at 2:02 PM
Who's Looking?