Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NOtherDev opened this issue Jan 22, 2012 · 0 comments

Comments

@NOtherDev
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant