Skip to content

NH-3884 - Default DateTime type can not be overridden #702

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

Merged
merged 3 commits into from
Jan 17, 2018

Conversation

fredericDelaporte
Copy link
Member

@fredericDelaporte fredericDelaporte commented Sep 22, 2017

NH-3884 (#844) - Default DateTime type can not be overridden

Here is a proposition for allowing overriding default clr type mapping to NHibernate type.

Such a method is quite low level, and for having a coherent session factory, it must be used before configuring and building the session factory. So I have put proper warnings in its comment.

Such a method could become handy if by doing NH-3919 as proposed here, we cause issues to some users.

@fredericDelaporte fredericDelaporte force-pushed the NH-3884 branch 2 times, most recently from 977e409 to aaed944 Compare September 26, 2017 10:07
@fredericDelaporte fredericDelaporte changed the title NH-3884 - Default DateTime type can not be overridden for SQL queries NH-3884 - Default DateTime type can not be overridden Sep 26, 2017
@fredericDelaporte
Copy link
Member Author

@hazzik, I think it would be better to merge this for v5.0 if ongoing #703 makes it too. This would give a way to revert the .Net DateTime default NHibernate type mapping semantic change for those who would need it.

@hazzik
Copy link
Member

hazzik commented Sep 28, 2017

I don't want to merge this at this stage. There is a really high chance that these methods would be made obsolete in a possible future type refactoring. I think what we can do now is to make some of RegisterType methods public (anyway these methods do the same as your SetDefaultType does).

@fredericDelaporte
Copy link
Member Author

The nearest is RegisterType(System.Type systemType, IType nhibernateType, IEnumerable<string> aliases) which takes an additional argument that will be unneeded for most users and also re-register the type alias (which should be unneeded for an override, but should not harm).

@fredericDelaporte
Copy link
Member Author

I will likely split that in many PR.

@fredericDelaporte
Copy link
Member Author

Rebased, the split in many PR and merge of the new PRs (#1483, #1484) having been done.

hazzik
hazzik previously approved these changes Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants