Skip to content

Nitrite/Java: Object must implement Mappable #44

Answered by anidotnet
neroux asked this question in Q&A
Discussion options

You must be logged in to vote

Not every object should implement Mappable, if you use jackson module to serialize the object.

// initialization using builder
Nitrite db = Nitrite.builder()
        .loadModule(storeModule)
        .loadModule(new JacksonMapperModule())  // this enables jackson serialization of object without using Mappable
        .openOrCreate("user", "password");

You need to include nitrite-jackson-mapper in your dependency for this.

If you don't want to include jackson dependency in your project, you should implement Mappable. And also, mappable implementation is faster than jackson serialization for obvious reason.

Replies: 0 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@neroux
Comment options

@anidotnet
Comment options

@neroux
Comment options

Answer selected by neroux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
nitrite-java Nitrite for Java
2 participants