-
Notifications
You must be signed in to change notification settings - Fork 230
Register custom converters
Sondre Eikanger Kvalø edited this page Oct 19, 2018
·
3 revisions
See steps and example code at Implementing and using custom converters.
Custom converters should be registered as part of a Quirks implementation which may be provided to the appropriate constructor upon instantiation of the Sql2o type. Example:
final Quirks quirks = new NoQuirks(){
{
converters.put(TypeToConvert.class, new CustomConverter());
}
};
final DataSource dataSource = //
final Sql2o sql2o = new Sql2o(dataSource, quirks);In the past, converters were registered globally using the static Converter.registerConverter method which is now deprecated. If you are creating your own converters you are advised follow Quirks approach shown above as the Convert class will be obsoleted and removed in later releases
Contributing
Documentation
- Configuration
- Fetching data from database
- Fetching data lazily
- Column mappings
- Updates and inserts
- Transactions
- Running queries in a batch
- Integration with Spring Framework
- Register custom converters
- Sql2o on Android
Other resources