Map a Strategy Pattern using Fluent NHibernate -


Basically the title of this question tells me what I'm trying to do, but to create an inappropriate example ...

I have a class, it's called an employee. Employee has an IP address ...

  Employees of public squares {iPad payday payment; Protected Internal Employee () {/ * NH / Public Public Required) (iPadBewien Payment Beverage) {_paymentBehavior = paymentBehavior; }}  

This corresponds to a database table like this:

dbo.Employees

> employee (primary key)
< Br>
PaymentBehaviourId (key to see foreign key)

field 1

field 2

field 3

field 4

/ P>

Depending on the value of PaymentBehaviourId, I need to 'inject' a different implementation of the iptv-Battery for the purpose of the employee

Can anyone tell me how to use Fluent-NHBernet Will be done?

  • Employee ID
  • Employee ID (primary key)
  • TypeBhid ID (foreign
  • type
  • Field 1
  • Field 3
  • Field 4
  • Classes

      Public Sector Employees {/ * ... * / Public PaymentBusiness PaymentBavier {Received; Set;}} Public Sector PaymentBehaviourA: IPaymentBehavior {/ * ... * / Public int field1 {get} set;}} public A class PaymentBehaviourB: IPaymentBehavior {/ * ... * / public int field2 {get} set;}}  

    I do not know whether FluentNHibernate is sufficient, it tells you what it looks like , But in XML you will specify it like this:

      class name = "employee" table = "employee" & gt; & lt; multiple-to-one name = "PaymentBavic" class = "iPad" />   & Lt; Subclass name = "PaymentBehaviourA" discriminator-value = "A" & gt; & Lt; Property Name = "Field 1" / & gt; & Lt; / Subclass & gt; & Lt; Subclass name = "PaymentBehaviourB" discriminator-value = "B" & gt; & Lt; Property Name = "Field2" /> & Lt; / Subclass & gt; & Lt; / Square & gt;  

    Comments

    Popular posts from this blog

    python - Overriding the save method in Django ModelForm -

    html - CSS autoheight, but fit content to height of div -

    qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -