fluent-nhibernate icon indicating copy to clipboard operation
fluent-nhibernate copied to clipboard

SqlInsert, SqlUpdate, SqlDelete, SqlDeleteAll should not be available in Component and DynamicComponent mappings

Open NOtherDev opened this issue 13 years ago • 0 comments

Fluent NHibernate 1.3 allows to map custom SQL queries in the Component and DynamicComponent mappings even if it's not supported by NHibernate. Setting SqlXYZ methods has no effect.

public class Group
{
    // ...
    public virtual Test Test { get; set; }
}

public class Test
{
    public virtual string TestProperty { get; set; }
}

public class GroupMap : ClassMap<Group>
{
    public GroupMap()
    {
        Component(x => x.Test, m =>
        {
            m.SqlInsert("select 1"); // should not be here
            m.SqlUpdate("select 1"); // should not be here
            m.SqlDelete("select 1"); // should not be here
            m.SqlDeleteAll("select 1"); // should not be here
        });
    }
}

See also: http://notherdev.blogspot.com/2012/01/mapping-by-code-component-and-odd-cases.html

NOtherDev avatar Jan 22 '12 18:01 NOtherDev