not really, my payments are really just strategies, so they have no
data, no state and thus are not entities. but it needs to be
persisted, that a certain entity uses a certain strategy. I use
strategies here to avoid to have to subclass everything. It is obvious
to me that otherwise would need MI soon, c# not providing this, i have
to build my classes behavior from the 'outside'. I do too much python
recently, probably ;)

On Thu, Nov 20, 2008 at 12:49 PM, Tiago Soczek <[EMAIL PROTECTED]> wrote:
> You can use the Any type mapping
> http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/mapping.html#mapping-types-anymapping
>
> See example with AR
>
> http://www.castleproject.org/activerecord/documentation/trunk/usersguide/relations/hasmanytoany.html
>
> On Thu, Nov 20, 2008 at 12:14 PM, Jan Limpens <[EMAIL PROTECTED]> wrote:
>>
>> I have a class Purchase (used by nh) that has an IPayment
>>
>> Currently I am having two implementations of that interface:
>>
>>        public class BankPayment : IPayment
>>        {
>>                public int NumberInstallments
>>                {
>>                        get { return 1; }
>>                }
>>        }
>>
>>        public class CreditCardPayment : IPayment
>>        {
>>                public CreditCardPayment(Creditcard card, int
>> numberInstallations,
>> Address billingAddress)
>>                {
>>                        Card = card;
>>                        NumberInstallments = numberInstallations;
>>                        BillingAddress = billingAddress;
>>                }
>>
>>                public Creditcard Card { get; private set; } // a
>> component, as well
>>                public int NumberInstallments { get; private set; }
>>                public Address BillingAddress { get; private set; } //
>> another component!
>>        }
>>
>> how can I map this as a component to Purchase? I truly have no idea...
>>
>> --
>> Jan
>> ___________________
>> [EMAIL PROTECTED]
>> www.limpens.com
>> +55 (11) 3082-1087
>> +55 (11) 3097-8339
>>
>>
>
>
> >
>



-- 
Jan
___________________
[EMAIL PROTECTED]
www.limpens.com
+55 (11) 3082-1087
+55 (11) 3097-8339

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