-
Notifications
You must be signed in to change notification settings - Fork 11
Add support for ObjectId
#70
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
Conversation
var expectedDoc = new BsonDocument() | ||
.append("insert", new BsonString("items")) | ||
.append( | ||
"documents", | ||
new BsonArray(List.of(new BsonDocument() | ||
.append("string1", new BsonString("s1")) | ||
.append("string2", new BsonString("s2")) | ||
.append("int32", new BsonInt32(1)) | ||
.append("boolean", BsonBoolean.TRUE) | ||
.append( | ||
"stringAndObjectId", | ||
new BsonArray(List.of( | ||
new BsonString("array element"), | ||
new BsonObjectId(new ObjectId(1, 2))))) | ||
.append("objectId", new BsonObjectId(new ObjectId(2, 0)))))); |
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.
This way it is easier to express what exactly we are expecting than with a string.
Looks great overall. Only some minor comments are left. |
src/integrationTest/java/com/mongodb/hibernate/id/ObjectIdFieldTypeIntegrationTests.java
Outdated
Show resolved
Hide resolved
Just found an edge case wherein explicit
|
src/main/java/com/mongodb/hibernate/internal/type/ObjectIdJavaType.java
Outdated
Show resolved
Hide resolved
Regarding #70 (comment)
This is because Hibernate ORM instantiates Done in 60c7345. |
If they are internal, I think the edge case doesn't make sense, right? I missed that point. Should we revert back this commit then if it is not a concern any more? |
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.
Let us revert back the edge-case related stuff if these type classes are internal ones, not meant to be used externally
It doesn't hurt to leave them as they are. It might improve our product robustness. |
Talked about this, and agreed to leave the changes: despite applications not being able to use |
HIBERNATE-23