Search in sources :

Example 16 with Sql2o

use of org.sql2o.Sql2o in project runelite by runelite.

the class CacheConfiguration method sql2o.

@Bean
@Qualifier("Runelite Cache SQL2O")
public Sql2o sql2o(DataSource dataSource) {
    Map<Class, Converter> converters = new HashMap<>();
    converters.put(Instant.class, new InstantConverter());
    return new Sql2o(dataSource, new NoQuirks(converters));
}
Also used : HashMap(java.util.HashMap) Converter(org.sql2o.converters.Converter) NoQuirks(org.sql2o.quirks.NoQuirks) Sql2o(org.sql2o.Sql2o) Qualifier(org.springframework.beans.factory.annotation.Qualifier) Bean(org.springframework.context.annotation.Bean)

Aggregations

Sql2o (org.sql2o.Sql2o)16 HashMap (java.util.HashMap)9 NoQuirks (org.sql2o.quirks.NoQuirks)8 Bean (org.springframework.context.annotation.Bean)7 Converter (org.sql2o.converters.Converter)7 InstantConverter (net.runelite.http.service.util.InstantConverter)6 Test (org.junit.Test)5 DataSource (javax.sql.DataSource)4 ConnectionParam (org.simpleflatmapper.db.ConnectionParam)3 SfmResultSetHandlerFactoryBuilder (org.simpleflatmapper.sql2o.SfmResultSetHandlerFactoryBuilder)2 Connection (org.sql2o.Connection)2 Query (org.sql2o.Query)2 Connection (java.sql.Connection)1 UUID (java.util.UUID)1 JdbcDataSource (org.h2.jdbcx.JdbcDataSource)1 Before (org.junit.Before)1 MappedObject16 (org.simpleflatmapper.beans.MappedObject16)1 DbObject (org.simpleflatmapper.test.beans.DbObject)1 Qualifier (org.springframework.beans.factory.annotation.Qualifier)1 SingleConnectionDataSource (org.springframework.jdbc.datasource.SingleConnectionDataSource)1