-
Notifications
You must be signed in to change notification settings - Fork 934
NH-3919 - Clean up and harmonize datetime types with regards to different dialects #703
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
fredericDelaporte
merged 13 commits into
nhibernate:master
from
fredericDelaporte:NH-3919
Oct 4, 2017
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
beab9cf
NH-2520 - Remove TimestampUtc
fredericDelaporte 168d2f7
NH-3905 - Fix test which may lack async generation.
fredericDelaporte 1464f48
NH-3919 - Use DateTime2 for dialects supporting it.
fredericDelaporte 472bad0
NH-3919 - Cease cutting milliseconds.
fredericDelaporte 612ea36
NH-3895 - Fix expand parameters too.
fredericDelaporte 2ee84a7
NH-3431 - Remove IDbDataParameter too.
fredericDelaporte 3be6668
NH-4083 - Cease specifying parameter length for ODBC string
fredericDelaporte 72aaccb
NH-3919 - More datetime tests and refactor them.
fredericDelaporte 7ac0206
NH-3919 - Obsolete TimestampType, check DateTime Kind
fredericDelaporte a15a1a5
NH-4084 - DbTimeStamp cause stale update exception
fredericDelaporte d7b30a5
NH-3919 - Document changes in date time types.
fredericDelaporte a83bcb2
NH-3919 - Handle date and time scale.
fredericDelaporte 55ebc64
NH-4086 - TimeType may lose fractional seconds.
fredericDelaporte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2638,14 +2638,30 @@ | |
<row> | ||
<entry><literal>DateTime</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry><literal>DbType.DateTime</literal> - ignores the milliseconds</entry> | ||
<entry>Default when no <literal>type</literal> attribute specified.</entry> | ||
<entry> | ||
<literal>DbType.DateTime</literal> / <literal>DbType.DateTime2</literal><co id="basic_mapping.datetime-co" linkends="basic_mapping.datetime"/> | ||
</entry> | ||
<entry> | ||
Default when no <literal>type</literal> attribute specified. Does no | ||
more ignore milliseconds since NHibernate v5.0. | ||
</entry> | ||
</row> | ||
<row> | ||
<entry><literal>DateTimeNoMs</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry> | ||
<literal>DbType.DateTime</literal> / <literal>DbType.DateTime2</literal><coref linkend="basic_mapping.datetime-co" /> | ||
</entry> | ||
<entry><literal>type="DateTimeNoMs"</literal> must be specified. Ignores milliseconds.</entry> | ||
</row> | ||
<row> | ||
<entry><literal>DateTime2</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry><literal>DbType.DateTime2</literal></entry> | ||
<entry><literal>type="DateTime2"</literal> must be specified.</entry> | ||
<entry> | ||
<literal>type="DateTime2"</literal> must be specified. Obsolete since | ||
NHibernate v5.0, use <literal>DateTime</literal> instead. | ||
</entry> | ||
</row> | ||
<row> | ||
<entry><literal>DateTimeOffset</literal></entry> | ||
|
@@ -2656,9 +2672,14 @@ | |
<row> | ||
<entry><literal>DbTimestamp</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry><literal>DbType.DateTime</literal> - as specific as database supports.</entry> | ||
<entry><literal>type="DbTimestamp"</literal> must be specified. When used as a <literal>version</literal> | ||
field, uses the database's current time rather than the client's current time.</entry> | ||
<entry> | ||
<literal>DbType.DateTime</literal> / <literal>DbType.DateTime2</literal><coref linkend="basic_mapping.datetime-co" /> | ||
</entry> | ||
<entry> | ||
<literal>type="DbTimestamp"</literal> must be specified. When used as a | ||
<literal>version</literal> field, uses the database's current time retrieved | ||
in dedicated queries, rather than the client's current time. | ||
</entry> | ||
</row> | ||
<row> | ||
<entry><literal>Decimal</literal></entry> | ||
|
@@ -2699,9 +2720,26 @@ | |
<row> | ||
<entry><literal>LocalDateTime</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry><literal>DbType.DateTime</literal> - ignores the milliseconds</entry> | ||
<entry><literal>type="LocalDateTime"</literal> must be specified. Ensures the | ||
<literal>DateTimeKind</literal> is set to <literal>DateTimeKind.Local</literal></entry> | ||
<entry> | ||
<literal>DbType.DateTime</literal> / <literal>DbType.DateTime2</literal><coref linkend="basic_mapping.datetime-co" /> | ||
</entry> | ||
<entry> | ||
<literal>type="LocalDateTime"</literal> must be specified. Ensures the | ||
<literal>DateTimeKind</literal> is set to <literal>DateTimeKind.Local</literal>. | ||
Throws if set with a date having another kind. | ||
Does no more ignore milliseconds since NHibernate v5.0. | ||
</entry> | ||
</row> | ||
<row> | ||
<entry><literal>LocalDateTimeNoMs</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry> | ||
<literal>DbType.DateTime</literal> / <literal>DbType.DateTime2</literal><coref linkend="basic_mapping.datetime-co" /> | ||
</entry> | ||
<entry> | ||
<literal>type="LocalDateTimeNoMs"</literal> must be specified. Similar to | ||
<literal>type="LocalDateTime"</literal> but ignores milliseconds. | ||
</entry> | ||
</row> | ||
<row> | ||
<entry><literal>PersistentEnum</literal></entry> | ||
|
@@ -2750,15 +2788,13 @@ | |
<row> | ||
<entry><literal>Timestamp</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry><literal>DbType.DateTime</literal> - as specific as database supports.</entry> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This was a lie. It just does not cut milliseconds as the old |
||
<entry><literal>type="Timestamp"</literal> must be specified.</entry> | ||
</row> | ||
<row> | ||
<entry><literal>TimestampUtc</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry><literal>DbType.DateTime</literal> - as specific as database supports.</entry> | ||
<entry><literal>type="TimestampUtc"</literal> must be specified. Ensures the | ||
<literal>DateTimeKind</literal> is set to <literal>DateTimeKind.Utc</literal></entry> | ||
<entry> | ||
<literal>DbType.DateTime</literal> / <literal>DbType.DateTime2</literal><coref linkend="basic_mapping.datetime-co" /> | ||
</entry> | ||
<entry> | ||
Obsolete, its <literal>Timestamp</literal> alias will be remapped to | ||
<literal>DateTime</literal> in a future version. | ||
</entry> | ||
</row> | ||
<row> | ||
<entry><literal>TrueFalse</literal></entry> | ||
|
@@ -2787,8 +2823,25 @@ | |
<row> | ||
<entry><literal>UtcDateTime</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry><literal>DbType.DateTime</literal> - ignores the milliseconds</entry> | ||
<entry>Ensures the <literal>DateTimeKind</literal> is set to <literal>DateTimeKind.Utc</literal></entry> | ||
<entry> | ||
<literal>DbType.DateTime</literal> / <literal>DbType.DateTime2</literal><coref linkend="basic_mapping.datetime-co" /> | ||
</entry> | ||
<entry> | ||
Ensures the <literal>DateTimeKind</literal> is set to <literal>DateTimeKind.Utc</literal>. | ||
Throws if set with a date having another kind. | ||
Does no more ignore milliseconds since NHibernate v5.0. | ||
</entry> | ||
</row> | ||
<row> | ||
<entry><literal>UtcDateTimeNoMs</literal></entry> | ||
<entry><literal>System.DateTime</literal></entry> | ||
<entry> | ||
<literal>DbType.DateTime</literal> / <literal>DbType.DateTime2</literal><coref linkend="basic_mapping.datetime-co" /> | ||
</entry> | ||
<entry> | ||
<literal>type="UtcDateTimeNoMs"</literal> must be specified. Similar to | ||
<literal>type="LocalDateTime"</literal> but ignores milliseconds. | ||
</entry> | ||
</row> | ||
<row> | ||
<entry><literal>YesNo</literal></entry> | ||
|
@@ -2800,6 +2853,16 @@ | |
</tgroup> | ||
</table> | ||
|
||
<calloutlist> | ||
<callout arearefs="basic_mapping.datetime-co" id="basic_mapping.datetime"> | ||
<para> | ||
Since NHibernate v5.0 and if the dialect supports it, <literal>DbType.DateTime2</literal> | ||
is used instead of <literal>DbType.DateTime</literal>. This may be disabled by setting | ||
<literal>sql_types.keep_datetime</literal> to <literal>true</literal>. | ||
</para> | ||
</callout> | ||
</calloutlist> | ||
|
||
<table> | ||
<title>System.Object Mapping Types</title> | ||
<tgroup cols="4"> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further hinting at the performance consequences it may have by mentioning it does that in dedicated queries.