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
--~--~---------~--~----~------------~-------~--~----~
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