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

Allow to map directly to fields #215

Closed
chester89 opened this issue Apr 3, 2013 · 3 comments
Closed

Allow to map directly to fields #215

chester89 opened this issue Apr 3, 2013 · 3 comments

Comments

@chester89
Copy link
Collaborator

NHibernate in its 3.3.1.4000 version allows to map directly to fields (mapping by code has that option). As far as I can tell, Fluent doesn't allow that right now. I'd like to add this, since it won't be too much pain. Or at least I think so. Definitely need to dig into the codebase to find if that's so. That would involve mapping primitive types, components and collections.

@chester89
Copy link
Collaborator Author

That's my bad. Mapping directly to fields through fluent interface DOES work. Here's my example: https://gist.github.com/chester89/5455538, in case someone would need it in future. The interesting thing is - as I used a field, there's no need to mark it virtual.

@chester89
Copy link
Collaborator Author

The question remains open whether Fluent will allow to - a) use a complex instance (with properties and stuff) as a non-public field and b) use same scenario for components

@chester89
Copy link
Collaborator Author

No, it doesn't work with components. Tried two scenarios - private field mapped as a component which has public properties, private field mapped as a component which has private fields. What's really strange is that in second case, I think correct hbm mapping was generated, but NH still can't find a property with a component name. Sad.

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

No branches or pull requests

1 participant