-
Notifications
You must be signed in to change notification settings - Fork 12
Add Instant support. #125
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
Add Instant support. #125
Conversation
| Object enabled = configurationValues.get("hibernate.type.java_time_use_direct_jdbc"); | ||
| if (enabled instanceof Boolean && (Boolean) enabled) { | ||
| throw new HibernateException(format( | ||
| "Configuration property [%s] is incubating and not supported in MongoDB dialect", |
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.
Offline review with Valentin:
Remove "is incubating" and "Mongo dialect"
src/main/java/com/mongodb/hibernate/jdbc/MongoPreparedStatement.java
Outdated
Show resolved
Hide resolved
HIBERNATE-42
ac167e0 to
d7b51e5
Compare
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.
Submitting intermediate review results.
...ava/com/mongodb/hibernate/internal/extension/service/StandardServiceRegistryScopedState.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/InstantIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/InstantIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/InstantIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/InstantIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/InstantIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/embeddable/EmbeddableIntegrationTests.java
Outdated
Show resolved
Hide resolved
...ionTest/java/com/mongodb/hibernate/embeddable/StructAggregateEmbeddableIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/BasicCrudIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/jdbc/MongoPreparedStatementIntegrationTests.java
Show resolved
Hide resolved
...va/com/mongodb/hibernate/query/select/temporal/AbstractSelectionTemporalIntegrationTest.java
Outdated
Show resolved
Hide resolved
src/main/java/com/mongodb/hibernate/jdbc/MongoPreparedStatement.java
Outdated
Show resolved
Hide resolved
|
The PR with all the proposed changes: vbabanin#1. |
# Conflicts: # src/main/java/com/mongodb/hibernate/dialect/MongoDialect.java
- Add tests for the forbidden temporal types. - Use TimestampUtcAsInstantJdbcType. - Rename test method and display names. HIBERNATE-42
Add test case for flattened unsupported id types.
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.
The last reviewed commit is 62e3e2f.
src/integrationTest/java/com/mongodb/hibernate/type/temporal/InstantIntegrationTests.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/type/temporal/UnsupportedItems.java
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/type/temporal/UnsupportedItems.java
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/type/temporal/UnsupportedItems.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/type/temporal/UnsupportedItems.java
Outdated
Show resolved
Hide resolved
...onTest/java/com/mongodb/hibernate/query/select/temporal/SelectionInstantIntegrationTest.java
Outdated
Show resolved
Hide resolved
...onTest/java/com/mongodb/hibernate/query/select/temporal/SelectionInstantIntegrationTest.java
Outdated
Show resolved
Hide resolved
...onTest/java/com/mongodb/hibernate/query/select/temporal/SelectionInstantIntegrationTest.java
Outdated
Show resolved
Hide resolved
...onTest/java/com/mongodb/hibernate/query/select/temporal/SelectionInstantIntegrationTest.java
Outdated
Show resolved
Hide resolved
...va/com/mongodb/hibernate/query/select/temporal/AbstractSelectionTemporalIntegrationTest.java
Outdated
Show resolved
Hide resolved
…nstantIntegrationTests.java Co-authored-by: Valentin Kovalenko <[email protected]>
…mporal/SelectionInstantIntegrationTest.java Co-authored-by: Valentin Kovalenko <[email protected]>
Add javadoc.
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.
The last reviewed commit is 087a70b.
src/integrationTest/java/com/mongodb/hibernate/type/temporal/InstantIntegrationTests.java
Outdated
Show resolved
Hide resolved
...onTest/java/com/mongodb/hibernate/query/select/temporal/SelectionInstantIntegrationTest.java
Outdated
Show resolved
Hide resolved
...egrationTest/java/com/mongodb/hibernate/query/select/SortingSelectQueryIntegrationTests.java
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/type/temporal/UnsupportedItems.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/type/temporal/UnsupportedItems.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/type/temporal/UnsupportedItems.java
Outdated
Show resolved
Hide resolved
src/integrationTest/java/com/mongodb/hibernate/type/temporal/SqlTimeIntegrationTests.java
Outdated
Show resolved
Hide resolved
Add test-case.
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.
The last reviewed commit is 101c1bf.
Hibernate ORM currently handles temporal types (Instant, etc.) inconsistently depending on where they appear in an entity. For example, saving an Instant of 10:15 (always UTC) on a host in GMT+1 leads to inconsistent results once read (tested with Postgres dialect):
This inconsistency makes it difficult to predict how temporal values will be stored and retrieved.
This PR ensures that temporal types are handled consistently in MongoDB extension across top-level fields, arrays/collections, and structs, so that serialization and deserialization behave uniformly regardless of context.
HIBERNATE-42