Yes... I tried to throw a specific exception about this matter but I can't:
the default entity name is the FullName of the class.We should find a place
where write this WARNING.
Robert, after a so beautiful and complete investigation, do you really want
that, this thread, will be the only one place where find a solution ?
If you don't think so please add a new wiki page to nh-forge... perhaps the
"How To" wiki is a good place where write
How to: mapping a class to a table and a view in seperate database schemas
http://nhforge.org/wikis/howtonh/default.aspx

There you can describe even the problem of entity-name.

Thanks.

2009/2/26 Robert Byrne <[email protected]>

>
> Finally figured this one out. The problem is that the entity names had
> a dot ('.') in them, this causes NHibernate to look through the
> persisters for the entity class mapping, and it ends up using them
> both (in SessionFactoryImpl.GetImplementors)
>
> In case anyone else is mapping the same class twice, make sure not to
> use dots in your entity names.
>
> On Feb 26, 8:32 pm, Robert Byrne <[email protected]> wrote:
> > I may have spoken too soon, it seems that both queries are still
> > issued for the entity specific mapping.
> >
> > On Feb 26, 7:07 pm, Robert Byrne <[email protected]> wrote:
> >
> > > Nevermind, this is fixed in the latest revision
> >
> > > On Feb 26, 5:51 pm, Robert Byrne <[email protected]> wrote:
> >
> > > > Running into a problem with entity name, so I just want to be sure
> I'm
> > > > getting it :)
> >
> > > > I have a single entity class with two separate nhibernate mappings,
> > > > one with an entity-name set, and the other with none (that is,
> entity-
> > > > name is not specified). If I attempt to list the entities using the
> > > > specific entity name, it gives me the results from both mappings.
> That
> > > > is:
> >
> > > > session.CreateCriteria("my specific entity name").List()
> >
> > > > Will give me twice as many results as normal. Looking at the logs, I
> > > > can see that it is executing 2 separate queries, one for the "my
> > > > specific entity name" and another for the 'default' mapping for the
> > > > entity class in question.
> >
> > > > Is this by design?
> >
> > > > On Feb 18, 5:16 am, Robert Byrne <[email protected]> wrote:
> >
> > > > > Thanks, fluent mapping solves a few other things I had with
> managing
> > > > > common mapping elements etc
> >
> > > > > On Feb 12, 1:34 pm, Fabio Maulo <[email protected]> wrote:
> >
> > > > > > You can use Fluent-NH until we don't implement "embedded-
> > > > > > Loquacious-mapping-configuration".
> >
> > > > > > 2009/2/12 Robert Byrne <[email protected]>
> >
> > > > > > > Schema action will be quite useful actually, for avoiding
> creating the
> > > > > > > view mapped tables when unit testing with sqlite etc.
> >
> > > > > > > Yes thats the idea I have in mind (entity name), using the
> current
> > > > > > > trunk revision.
> >
> > > > > > > Is there an easy way to 'clone' the mappings of the first
> entity? That
> > > > > > > is, I have one entity that is defined by the .hbm.xml (mapped
> to the
> > > > > > > dbo/view schema), and I want to start with a copy of that
> mapping,
> > > > > > > then add the additional property and set the schema name for
> the
> > > > > > > second mapping. Or will I have to build up the 'clone'
> manually, by
> > > > > > > deep copying over all the metadata from the first mapping?
> >
> > > > > > > On Feb 12, 3:46 am, Fabio Maulo <[email protected]> wrote:
> > > > > > > > If you are thinking in entity-name it is because you are
> using the
> > > > > > > trunk.To
> > > > > > > > map a view now you can use the new tag
> > > > > > > > schema-action="none|drop|export|update|validate|all"
> >
> > > > > > > > To map two different entities (they have different
> properties; one
> > > > > > > > difference is enough) you can use the tag "schema"
> >
> > > > > > > > 2009/2/11 Robert Byrne <[email protected]>
> >
> > > > > > > > > I'm looking for feedback on the best way to do the
> following:
> >
> > > > > > > > > Map a class to a view in sql server (its in the 'dbo'
> schema) and map
> > > > > > > > > the same class to the table which backs up that view (its
> in a
> > > > > > > > > separate database schema, 'tableschema').
> >
> > > > > > > > > The table has an additional column that the view doesn't
> have, apart
> > > > > > > > > from that they are identical.
> >
> > > > > > > > > I'm currently thinking that the way to do this is to use
> the entity-
> > > > > > > > > name feature to create a duplicate mapping for the
> 'tableschema'
> > > > > > > > > entities. I can loop over the metadata before the session
> factory is
> > > > > > > > > built, clone the metadata and make the changes - set the
> database
> > > > > > > > > schema and add the additional property mapping.
> >
> > > > > > > > > Does this make sense? Is there a better way? Most
> importantly, is it
> > > > > > > > > possible.
> >
> > > > > > > > > Also, any advice on the best way to clone the metadata for
> a class?
> >
> > > > > > > > > Thanks,
> > > > > > > > > Rob.
> >
> > > > > > > > --
> > > > > > > > Fabio Maulo
> >
> > > > > > --
> > > > > > Fabio Maulo
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to