You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some custom mappings done with nhibernate. If my relation is based on simple key, everything works fine. But if my relation is based on composite key, the object children are not hydrated although the sql query generated is correct.
Here is my mapping code:
if(isVersioning){//coposed key not hydratingclassMapper.Set(setProperty,
set =>{set.Table($"{table.DBName}{baseReferenceField.DBName}");set.Schema("Versions");set.Key(k =>k.Columns(c =>c.Name(table.DBName), c =>c.Name("Version")));set.Cascade(Cascade.None);},
elem =>{elem.ManyToMany(e =>{e.Column(baseReferenceField.DBName);e.Class(setProperty.PropertyType.GetGenericArguments()[0]);});});}else{//works fineclassMapper.Set(setProperty,
set =>{set.Table($"{table.DBName}{baseReferenceField.DBName}");set.Schema("Data");set.Key(k =>k.Column(table.DBName));set.Cascade(Cascade.None);},
elem =>{elem.ManyToMany(e =>{e.Column(baseReferenceField.DBName);e.Class(setProperty.PropertyType.GetGenericArguments()[0]);});});}
The text was updated successfully, but these errors were encountered:
the object children are not hydrated although the sql query generated is correct
I don't understand what it means. Please provide at least code snippet when it happens (does it happen on session.Get or it needs to be a query?). Does it throw any exception (if so provide full stacktrace)?
There is no exception. The query is generated just fine and runs on sql server (as seen from profiler), but my resulting object (from mapping) does not contain any data (again, only when I'm using a composite key for foreign constraint)
Uh oh!
There was an error while loading. Please reload this page.
Hello!
I have some custom mappings done with nhibernate. If my relation is based on simple key, everything works fine. But if my relation is based on composite key, the object children are not hydrated although the sql query generated is correct.
Here is my mapping code:
The text was updated successfully, but these errors were encountered: