I have the following entities, mapped by code:
VarRecipeMapping.cs
public VarRecipeMapping()
{
Table("var_recipe");
// ...
Bag(x => x.Entries, m =>
{
m.Cascade(Cascade.All | Cascade.DeleteOrphans);
m.Lazy(CollectionLazy.NoLazy);
},
a => a.OneToMany());
}
VarRecipeEntryMapping.cs
public VarRecipeEntryMapping()
{
Table("var_recipe_entry");
// ...
ManyToOne(x => x.Recipe, m =>
{
m.Column("var_recipe_id");
m.NotNullable(true);
});
}
What annoys me is the resulting database (SQLite): it contains all columns of my entites defined by Column
plus an additional, unused Recipe
column in the var_recipe_entry
table.
Obviously generated by NHibernate due to having a field called Recipe
in the model.
What can I do to get rid of this useless field?