Hello everyone!
I'm a little bit confused about how to set the unsaved-value policy
for the id properties. Is there any pattern to do it with conform?
My problem is that sometimes I need to use as primary key a Guid
created by myself
var id = new Guid("11111111-2222-3333-4444-555555555555");
var user = new User(id);
Session.Save(user);
...but, when I try to retrieve it from the db, I discover that it has
been persisted with a different id (and also the istance of user has
it changed). Taking a look at the xml of the hbm generated by my
mapping, I found out that the id is done in this way:
<class name="Test.User, Test, Version=0.1.0.0, Culture=neutral,
PublicKeyToken=null">
<id name="Id" type="Guid">
<generator class="guid.comb" />
</id>
<property name="Name" />
<property name="Surname" />
</class>
cause I put Orm.Patterns.PoidStrategies.Add(new
GuidOptimizedPoidPattern()); in my definition.
Referring to [1] I suspect I need to add the property unsaved-
value="id_value" to achieve what I need, but I have no idea how to do
it with ConfORM. Can someone point me to the right direction, please?
Thank you,
Mat.
[1]:
http://knol.google.com/k/nhibernate-chapter-5-basic-o-r-mapping#5(2E)1(2E)4(2E)(C2)(A0)id