Giter Site home page Giter Site logo

The method saveDBObject assumes that the "id" field in the document is of the type ObjectId - results in cast exception when not using autogenerated ids [DATAMONGO-38] about spring-data-mongodb HOT 3 CLOSED

spring-projects avatar spring-projects commented on May 12, 2024
The method saveDBObject assumes that the "id" field in the document is of the type ObjectId - results in cast exception when not using autogenerated ids [DATAMONGO-38]

from spring-data-mongodb.

Comments (3)

spring-projects-issues avatar spring-projects-issues commented on May 12, 2024

Gunnar Sigurdsson commented

Reading through MongoTemplate is seems like this is not just an issue with saveDBObject(). Looks like insertDBObjectList() is making incorrect assumptions about ObjectId.

This is a blocker issue for us in terms of adopting this project. I strongly recommend that a fix for this issue be included in 1.0.0.

This is discussed here: http://forum.springsource.org/showthread.php?t=104461. From this thread:


Thanks for the replies. I have spent some time looking at the code, especially MongoTemplate and see the way ObjectId is assumed in several places. However, it seems like a bad implementation decision and an easy thing to fix.

We are heavily invested in spring and have been using mongo for a while and were hoping to adopt the spring mongo integration asap. This looks like the only blocker.

We are using Jackson to serialize/deserialize java objects to/from JSON and the mongo java driver to go between JSON and DBObject. It is trivial to hook our Jackson infrastructure into MongoTemplate by implementing the MongoReaderWriter interface. We have already tried this out. This would allow us to keep using Jackson while the spring mongo project comes up with a useable serialization/deserialization mechanism.

from spring-data-mongodb.

spring-projects-issues avatar spring-projects-issues commented on May 12, 2024

Oliver Drotbohm commented

That should be fixed in the meantime already. Could you please try a SNAPSHOT to see if it works for you?

from spring-data-mongodb.

spring-projects-issues avatar spring-projects-issues commented on May 12, 2024

Thomas Risberg commented

There was still a cast in the save method. I removed that

from spring-data-mongodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.