-
Notifications
You must be signed in to change notification settings - Fork 5
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 support for ObjectId
#70
base: main
Are you sure you want to change the base?
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. |
HIBERNATE-23