Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automapper overrides joins for sub classes #348

Closed

Conversation

banias
Copy link
Contributor

@banias banias commented Jul 8, 2016

Currently Fluent NHibernate ignores Automapping overrides for subclasses that uses in a class hierarchy with discriminator column.

Thus, it's impossible to produce an hibernate mapping that mixes Table-per-subclass and Table-per-hierarchy like:

<class name="Payment" table="PAYMENT">
    <id name="Id" type="Int64" column="PAYMENT_ID">
        <generator class="native"/>
    </id>
    <discriminator column="PAYMENT_TYPE" type="string"/>
    <property name="Amount" column="AMOUNT"/>
    ...
    <subclass name="CreditCardPayment" discriminator-value="CREDIT">
        <join table="CREDIT_PAYMENT">
            <property name="CreditCardType" column="CCTYPE"/>
            ...
        </join>
    </subclass>
    <subclass name="CashPayment" discriminator-value="CASH">
        ...
    </subclass>
    <subclass name="ChequePayment" discriminator-value="CHEQUE">
        ...
    </subclass>
</class>

My commit fixes this problem: Join override can now be used both for class and subclass automapper overrides.

@chester89
Copy link
Collaborator

Somehow I overlooked this, sorry. Will take a look tomorrow

@banias
Copy link
Contributor Author

banias commented Aug 19, 2016

Sure, no problem :)

@chester89
Copy link
Collaborator

TeamCity verified this for 4.0, but I still need to figure out if this is 3.5 compatible

govorovvs added a commit to govorovvs/fluent-nhibernate that referenced this pull request Nov 16, 2017
@hazzik
Copy link
Member

hazzik commented Sep 18, 2020

Recreated the PR: #467

@hazzik hazzik closed this Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants