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

Defining a CustomType for KeyReference in CompositeId() #78

Closed
m4cx opened this issue Jul 27, 2011 · 1 comment · Fixed by #367
Closed

Defining a CustomType for KeyReference in CompositeId() #78

m4cx opened this issue Jul 27, 2011 · 1 comment · Fixed by #367
Labels

Comments

@m4cx
Copy link

m4cx commented Jul 27, 2011

Hey Guys,

I opened this topic within stackoverflow already, but until now there is no answer. Maybe you can have a look:

http://stackoverflow.com/questions/6827154/mapping-compositeid-keyreference-on-interface

Thanks.

@Sebazzz
Copy link
Contributor

Sebazzz commented Jan 10, 2017

You're right, there is currently no support. To make matters worse, Fluent NHibernate does set the class attribute in the mapping, causing NHibernate to ignore entity-name. This causes mapping to any interface to fail.

My current workaround was to export the mapping to XML (using ExportTo), then using the XML mappings from the classes I couldn't properly map in code.

In short:

  1. Fluent NHibernate should not set the class attribute unless specifically asked by the user. This is not something that could be done in a minor release as it can break working code.
  2. Allow specifying the class of a KeyReference (key-many-to-one in XML).

hazzik pushed a commit that referenced this issue Sep 18, 2020
* Allow setting class type of keyreference, allowing interfaces or abstract classes to be mapped.

Fixes #78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants