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'm fairly new to NHibernate and recently went over from ODM for this new project.
Not sure if I'm thinking crazy here with this design or this is a limitation in fnh:
My ShipmentPlan entity has two nullable columns, PackPlanId and LoadPlanId. They are referencing the same entity so I'm trying to figure out some kind of one-to-one mapping for both columns.
After desperate trial-and-errors, the only setup I have some success with is is the mapping below.
public OptimizationPlanMap()
{
HasOne(x => x.ShipmentPlan).Cascade.All();
}
The problem is when I try to save the entity, even though the references looks right before saving, it crashed because ShipmentPlanId is not assigned and not in the insert query.
Entity before saving:
I'm fairly new to NHibernate and recently went over from ODM for this new project.
Not sure if I'm thinking crazy here with this design or this is a limitation in fnh:
My ShipmentPlan entity has two nullable columns, PackPlanId and LoadPlanId. They are referencing the same entity so I'm trying to figure out some kind of one-to-one mapping for both columns.
After desperate trial-and-errors, the only setup I have some success with is is the mapping below.
The problem is when I try to save the entity, even though the references looks right before saving, it crashed because ShipmentPlanId is not assigned and not in the insert query.
Entity before saving:
Query:
The success I had with this setup is I can fetch the entities correctly but as you see the saving part is not working.
Is this a issue in the design or mapping?
The text was updated successfully, but these errors were encountered: