| Package | Description |
|---|---|
| com.cvent.dropwizard.mybatis.typehandlers |
| Modifier and Type | Class and Description |
|---|---|
class |
URITypeHandler
URI type handler
|
class |
UUIDTypeHandler
Add this type handler to your MyBatis SqlSessionFactory's configuration like so:
sessionFactory.getConfiguration()
.getTypeHandlerRegistry()
.register(UUID.class, UUIDTypeHandler);
Or to use with default null-value
sessionFactory.getConfiguration()
.getTypeHandlerRegistry()
.register(UUID.class, new UUIDTypeHandler(new UUID(0L, 0L));
When MyBatis encounters a UUID property during the mapping process, it will use this
class to convert the result from the DB to a UUID.
|
Copyright © 2019. All rights reserved.