Hello Fabio,
Many thanks for the response!
So, it looks like I've misunderstood the join attribute.
What I wish to know, in other words, is whether there's a way to map
an entity in a way that'll correspond to the following SQL:
SELECT Item.Title, Language.Name AS Language, Publisher.Name AS
Publisher
FROM Item INNER JOIN
Language ON Item.LanguageID = Language.ID INNER
JOIN
Publisher ON Item.PublisherID = Publisher.ID
This would allow me to load certain information faster than using the
classic table-per-class mapping, esp. when doing bulk loading
(GetAll<Item>()).
On Dec 25, 3:45 pm, "Fabio Maulo" <[email protected]> wrote:
> Probably I don't understand exactly what you are looking for...<join> is
> used to represent the same class in more than one table.
> Two records, one in the "main" table and the other in the "slave" table, are
> representing the same entity instance and for that both have the same POID
> (the POID of the "master").
> The <join> feature was introduced to support some legacy DB and its target
> is more oriented to improve the inheritance mapping strategies (mixing
> table-per-class with table-per-class-hierency).
>
> Do you can explain exactly why you want use <join> ?
>
> 2008/12/25 Nieve <[email protected]>
>
>
>
>
>
> > Hello there,
> > I'm trying to create a light entity consisting of several properties
> > of multiple table, as described in the following discussion:
>
> >http://groups.google.com/group/nhusers/browse_thread/thread/38e7ebc04...
>
> > Now, the thing is that I wish to use a join on the two tables, so that
> > when doing massive reading from the database, the less data that'll be
> > read, the faster will the query will go, which is why I prefer not to
> > use the solution suggested in the aforementioned discussion.
> > I would like to know whether a <Join Table="MyTable"> could be used
> > with specifying the join column on the primary entity/table. From what
> > I've seen, the join takes the ID column. The only way I found to do
> > this was to declare the foreign key column as the ID of the primary
> > table (if to use the example given in that discussion it'll be:
> > <class name="Car">
> > <id name ="EngineID"> <--obviously not good-->
> > ...
> > <join table="Engines">
> > <key column="ID"/>
> > <property name="NumberOfCylinders" column="NumCylinders"/>
> > </join>
> > This, obviously, is not the way to go, but it pretty well illustrates
> > what I wish to do.)
>
> > Any ideas and comments would be highly appreciated!
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---