Sure, here's my code:

IPersistenceConfigurer database =
MsSqlConfiguration.MsSql2005.ConnectionString("MyConnectionString");
Configuration configNH = new Configuration();

Fluently.Configure(configNH)
                .Database(database)
                .Mappings(
                     m => m.FluentMappings.AddFromAssembly
                              (MySpecificAssembly)
                              .ExportTo(txtPath.Text))
                .ExposeConfiguration(
                         c => new SchemaExport(c).SetOutputFile
                                (txtPath.Text + "\\script.sql").Execute
(false, true, false))
                .BuildSessionFactory();

When I run this code no errors are thrown, and the same routine works
for other mappings,
but the error is when the inheritance is from another assembly, like I
explain before.

Thanks for any help.


On 15 dic, 08:09, James Gregory <[email protected]> wrote:
> How are you generating the schema? Can you show us the code you're using.
>
>
>
> On Tue, Dec 15, 2009 at 12:01 PM, Argons <[email protected]> wrote:
> > Yes, little error, I have changed to SpecificUser, but with the same
> > result, when I want to generate the schema none of the tables are
> > generated.
>
> > On 14 dic, 12:30, James Gregory <[email protected]> wrote:
> > > public class SpecificUserMap : SubclassMap<User>
>
> > > should be
>
> > > public class SpecificUserMap : SubclassMap<SpecificUser>
>
> > > On 12/14/09, Argons <[email protected]> wrote:
>
> > > > Well, first of all sorry for my english.
>
> > > > This is my problem, I have an assembly with some classes like User,
> > > > Role, etc. these are generic clases for all my applications so I need
> > > > to inherit from these classes for each of my app's and add custom
> > > > properties like this:
>
> > > > public class User
> > > > {
> > > >     public int IdUser { get; set;}
> > > >     public string Login { get; set; }
> > > >     public string Password { get; set; }
>
> > > >     public Role ObjRole { get; set; }
> > > > }
>
> > > > public class SpecificUser : User
> > > > {
> > > >     public DateTime LastLogin { get; set; }
> > > >     public string Type { get; set; }
> > > > ...
> > > > }
>
> > > > SpecificUser is in another assembly and I try to map like this:
>
> > > > public class SpecificUserMap : SubclassMap<User>
> > > >    {
> > > >            public SpecificUserMap()
> > > >            {
> > > >                    KeyColumn("IdUser");
> > > >                    Map(x => x.LastLogin).Not.Nullable();
> > > >                    Map(x => x.Type).Not.Nullable();
> > > >                    ...
> > > >            }
> > > >    }
>
> > > > But when I try to generate the schema it doesn't generate the table
> > > > SpecifiUser. Am I doing something wrong? How can I do the mapping?
>
> > > > Thanks in advance for the help.
>
> > > > Ariel.
>
> > > > --
>
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Fluent NHibernate" group.
> > > > To post to this group, send email to
> > [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected]<fluent-nhibernate%2bunsubscr­[email protected]>
> > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/fluent-nhibernate?hl=en.-Ocultar texto
> > de la cita -
>
> > > - Mostrar texto de la cita -
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Fluent NHibernate" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<fluent-nhibernate%2bunsubscr­[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/fluent-nhibernate?hl=en.- Ocultar texto de la 
> >cita -
>
> - Mostrar texto de la cita -

--

You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.


Reply via email to