Finally Got It!  You were both right,* I just did not understand it*.

For those of you who are struggling with the same problem this is what you
do.
NOTE: I am using Fluent NHibernate, I am also using Sharp Architecture so
all of my classes inherit from Entity which has an Id column

In the TableA class add a reference to TableATableB
public virtual IList<TableATableB> SymposiaEventSymposiaCityUsers { get;
protected set; }

TableATableB (Class) is defined like this:

 public class SymposiaEvent_SymposiaCityUser:Entity {
        public virtual TableA TableA { get; protected set; }
        public virtual TableB TableB { get; protected set; }
        public virtual TableBType TableBType{ get; protected set; }
 }

The table looks like this
CREATE TABLE [dbo].[TableATableB](
[TableATableBId] [int] IDENTITY(1,1) NOT NULL,
[TableAId] [int] NOT NULL,
[TableBId] [int] NOT NULL,
[TableBTypeId] [int] NOT NULL

That is all I had to do.  I was trying to create a composite key, and other
things in a mapping class, this was throwing me off.

Lesson Learned:  Start very very simple FIRST! (And read the posts
carefully)



On Thu, Aug 5, 2010 at 8:58 PM, John Davidson <[email protected]> wrote:

> Back when the thread started Jose advised that you needed to map the
> tableab entity. You need to do this because you have an extra property that
> is not derived from the tablea or tableb entities.
>
> John Davidson
>
>
> On Thu, Aug 5, 2010 at 8:48 PM, The CodeFool <[email protected]>wrote:
>
>> Yes.  I think it is a mapping issue.  I think it has to do with the
>> ability to map each class as its own entity tableab does not have a mapped
>> class.  Therefore there is a composite key on table ab and NH cannot map
>> it.
>>
>> On Aug 5, 2010 5:32 PM, "John Davidson" <[email protected]> wrote:
>>
>> Have you looked at DetachedCriteria for the subselect?
>>
>> John Davidson
>>
>> On Thu, Aug 5, 2010 at 1:46 PM, The CodeFool <[email protected]>
>> wrote:
>>
>>> >
>>> > Hi,
>>> >
>>> > I have literally been trying to work it out for this long!
>>> >
>>> > That got me a little furt...
>>>
>>> --
>>>
>>> > You received this message because you are subscribed to the Google
>>> Groups "nhusers" group.
>>> > To po...
>>>
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "nhusers" group.
>> To po...
>>
>>  --
>> 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]<nhusers%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>>
>
>  --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

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