Skip to content

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

Open
@NOtherDev

Description

@NOtherDev

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions