Technology moves fast! ⚑ Don't get left behind.🚢 Subscribe to our mailing list to keep up with latest and greatest in open source projects! πŸ†


Subscribe to our mailing list

Rosetta

Java library that leverages Jackson to take the pain out of mapping objects to/from the DB, designed to integrate seamlessly with jDBI

Subscribe to updates I use Rosetta


Statistics on Rosetta

Number of watchers on Github 76
Number of open issues 6
Average time to close an issue 17 days
Main language Java
Average time to merge a PR about 23 hours
Open pull requests 5+
Closed pull requests 2+
Last commit about 1 year ago
Repo Created over 4 years ago
Repo Last Updated about 1 year ago
Size 291 KB
Organization / Authorhubspot
Latest ReleaseRosetta-3.11.8
Contributors6
Page Updated
Do you use Rosetta? Leave a review!
View open issues (6)
View Rosetta activity
View on github
Fresh, new opensource launches πŸš€πŸš€πŸš€
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating Rosetta for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Rosetta Build Status

Overview

Rosetta is a Java library that leverages Jackson to take the pain out of mapping objects to/from the DB, designed to integrate seamlessly with jDBI. Jackson is extremely fast, endlessly configurable, and already used by many Java webapps.

Rosetta isn't an ORM. It doesn't silently read and write to your database, validate input, or manage connections. It does two things:

  1. Binds Java objects to query parameters using a jDBI BindingAnnotation
  2. Maps query results back to Java objects using a jDBI ResultSetMapperFactory

Usage

To use with jDBI on Maven-based projects, add the following dependency:

<dependency>
  <groupId>com.hubspot.rosetta</groupId>
  <artifactId>RosettaJdbi</artifactId>
  <version>{latest version}</version>
</dependency>

Latest version can be seen here

Binding

You can bind JDBI arguments in your DAO using @BindWithRosetta.

public interface MyDAO {
  @SqlUpdate("UPDATE my_table SET name = :name, type = :type WHERE id = :id")
  void update(@BindWithRosetta MyRow obj);
}

@BindWithRosetta behaves like jDBI's @BindBean, but it converts the object to a tree using Jackson which lets you use all the Jackson annotations you know and love to customize the representation. It's also generally more robust - it supports the not-quite-standard naming conventions, enums, fluent setters, nested objects (with dot-notation), getters without fields, etc.

Mapping

To register Rosetta globally for mapping, you can add it to your DBI like so:

dbi.registerMapper(new RosettaMapperFactory());

Or to test it out on a single DAO you would do:

@RegisterMapperFactory(RosettaMapperFactory.class)
public interface MyDAO { /* ... */ }

Or to use in combination with a Handle: (same idea to register on a Query)

handle.registerMapper(new RosettaMapperFactory());

Advanced Features

For a list of advanced features, see here

Rosetta open issues Ask a question     (View All Issues)
  • almost 3 years Exception when trying to @JsonSerialized a nested polymorphic field annotated with @JsonTypeInfo
  • almost 3 years Rosetta & Joda-Time
  • over 3 years @JsonDeserialize does not function properly with @StoredAsJson
  • almost 4 years Allow @StoredAsJson to customize the serialization inclusion setting on the object mapper
Rosetta open pull requests (View All Pulls)
  • intern common generated column name strings
  • Add Support for More Flexible ObjectMapper Configuration
  • Force inclusion to ALWAYS
  • New Release: Rosetta-3.11.4
  • Creating tests to show that `@StoredAsJson` works for generic `@JsonT…
Rosetta questions on Stackoverflow (View All Questions)
  • Django Rosetta DjangoUnicodeDecodeError
  • Django rosetta url strange behaviour
  • Discrepency in Matlab FFT and Fortran Rosetta Code FFT
  • How to change language on the template in django-rosetta
  • Can I run rosetta with webapp2 in gae?
  • How does the exclude work in Django-Rosetta
  • Add translation for model field using django rosetta
  • A 'Rosetta Stone' for Swift's optional types?
  • Drawing A Rosetta Shape
  • Django CMS and Rosetta: Can't get template messages translated
  • Django - Rosetta : Ignore .mo files issue
  • django translation not working by django-rosetta
  • Does not update translations in rosetta for Django
  • Do jQuery ajax calls using JSONP need to be modified (or avoided) due to Rosetta Flash exploit
  • Django Rosetta - translate by user permission rather than "translators" group
  • Login in Django Rosetta
  • C Fast Median Filter on Rosetta Stone (C I/O and images)
  • javascript syntax - rosetta code merge sort
  • should changes of translations in django rosetta propagate automatically to frontend?
  • django-rosetta stop working due to google api changes, any alternative?
  • PHP translation frontend similar to Rosetta?
  • django-rosetta translated phrases not appearing on pages
  • Windows/Linux rosetta stone for C++ development?
  • select() in C: the Rosetta stone?
  • django-rosetta not saving translations on hitting "Save and Translate next block" in Chrome
  • Are there group permissions for django-rosetta?
  • Can install django-rosetta package using "easy_install".
  • How to tell if rosetta is installed? --MacPython
  • What language/ software does Rosetta stone use?
  • django-rosetta file is read only
Rosetta list of languages used
Rosetta latest release notes

Fixed issues where @StoredAsJson did not work with polymorphic data types using @JsonTypeInfo #54 #55

  • Fix NPE described in #50
  • Fix issue where @JsonTypeInfo + @StoredAsJson don't work together when used on a List field (#51) (thanks to @ldriscoll)
Other projects in Java