Hi Folks,
I am trying to map a view which has a HasMany relationship with a table:
public Object1Map()
{
WithTable("VIEW1");
UseCompositeId()
.WithKeyProperty(x => x.Property1, "Field1")
.WithKeyProperty(x => x.Property2, "Field2");
Map(x => x.Property3, "Field3").ReadOnly();
Map(x => x.Property4,"Field4").ReadOnly();
HasMany<Object2>(x => x.Object2s)
.KeyColumnNames.Add("Field1")
.KeyColumnNames.Add("Field2")
.Cascade.All()
.LazyLoad()
.NotFound.Ignore();
}
I just want to call Save for Object1 which is parent for Object2s
collection in order to save Object2s collection; and do not need to
save view properties at the parent level.I don't want to make the
whole class readonly because I need to be able to save the child
collection(Object2s) which mapped to a table but I need to make the
composite keys readonly as the other properties of the view.
Is it possible to make composite keys readonly?Is it possible to
persist a collection which it's parent is a View?
The sql that is generated is
INSERT INTO VIEW1(Field1, Field2) VALUES (:p0, :p1); :p0 = '', :p1 = '':
which is ubderstandable from the above mapping but it is not what I need.
Thanks in advance,
Silvia
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---