Search in sources :

Example 1 with InstantConverter

use of net.runelite.http.service.util.InstantConverter in project runelite by runelite.

the class SpringBootWebApplication method cacheSql2o.

@Bean("Runelite Cache SQL2O")
Sql2o cacheSql2o() throws NamingException {
    DataSource dataSource = (DataSource) getContext().lookup("jdbc/runelite-cache2");
    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) InstantConverter(net.runelite.http.service.util.InstantConverter) Converter(org.sql2o.converters.Converter) InstantConverter(net.runelite.http.service.util.InstantConverter) NoQuirks(org.sql2o.quirks.NoQuirks) Sql2o(org.sql2o.Sql2o) DataSource(javax.sql.DataSource) Bean(org.springframework.context.annotation.Bean)

Example 2 with InstantConverter

use of net.runelite.http.service.util.InstantConverter in project runelite by runelite.

the class SpringBootWebApplication method trackerSql2o.

@Bean("Runelite XP Tracker SQL2O")
Sql2o trackerSql2o() throws NamingException {
    DataSource dataSource = (DataSource) getContext().lookup("jdbc/runelite-tracker");
    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) InstantConverter(net.runelite.http.service.util.InstantConverter) Converter(org.sql2o.converters.Converter) InstantConverter(net.runelite.http.service.util.InstantConverter) NoQuirks(org.sql2o.quirks.NoQuirks) Sql2o(org.sql2o.Sql2o) DataSource(javax.sql.DataSource) Bean(org.springframework.context.annotation.Bean)

Example 3 with InstantConverter

use of net.runelite.http.service.util.InstantConverter in project runelite by runelite.

the class SpringBootWebApplicationTest method cacheSql2o.

@Bean("Runelite Cache SQL2O")
Sql2o cacheSql2o() throws NamingException {
    Map<Class, Converter> converters = new HashMap<>();
    converters.put(Instant.class, new InstantConverter());
    return new Sql2o("jdbc:mysql://192.168.1.2/cache", "runelite", "runelite", new NoQuirks(converters));
}
Also used : HashMap(java.util.HashMap) InstantConverter(net.runelite.http.service.util.InstantConverter) Converter(org.sql2o.converters.Converter) InstantConverter(net.runelite.http.service.util.InstantConverter) NoQuirks(org.sql2o.quirks.NoQuirks) Sql2o(org.sql2o.Sql2o) Bean(org.springframework.context.annotation.Bean)

Example 4 with InstantConverter

use of net.runelite.http.service.util.InstantConverter in project runelite by runelite.

the class SpringBootWebApplicationTest method xpSql2o.

@Bean("Runelite XP Tracker SQL2O")
Sql2o xpSql2o() throws NamingException {
    Map<Class, Converter> converters = new HashMap<>();
    converters.put(Instant.class, new InstantConverter());
    return new Sql2o("jdbc:mysql://192.168.1.2/xptracker", "runelite", "runelite", new NoQuirks(converters));
}
Also used : HashMap(java.util.HashMap) InstantConverter(net.runelite.http.service.util.InstantConverter) Converter(org.sql2o.converters.Converter) InstantConverter(net.runelite.http.service.util.InstantConverter) NoQuirks(org.sql2o.quirks.NoQuirks) Sql2o(org.sql2o.Sql2o) Bean(org.springframework.context.annotation.Bean)

Example 5 with InstantConverter

use of net.runelite.http.service.util.InstantConverter in project runelite by runelite.

the class SpringBootWebApplicationTest method sql2o.

@Bean("Runelite SQL2O")
Sql2o sql2o() {
    Map<Class, Converter> converters = new HashMap<>();
    converters.put(Instant.class, new InstantConverter());
    return new Sql2o("jdbc:mysql://192.168.1.2/runelite", "runelite", "runelite", new NoQuirks(converters));
}
Also used : HashMap(java.util.HashMap) InstantConverter(net.runelite.http.service.util.InstantConverter) Converter(org.sql2o.converters.Converter) InstantConverter(net.runelite.http.service.util.InstantConverter) NoQuirks(org.sql2o.quirks.NoQuirks) Sql2o(org.sql2o.Sql2o) Bean(org.springframework.context.annotation.Bean)

Aggregations

HashMap (java.util.HashMap)6 InstantConverter (net.runelite.http.service.util.InstantConverter)6 Bean (org.springframework.context.annotation.Bean)6 Sql2o (org.sql2o.Sql2o)6 Converter (org.sql2o.converters.Converter)6 NoQuirks (org.sql2o.quirks.NoQuirks)6 DataSource (javax.sql.DataSource)3