Comment

Comment by Xorlev

For those of us on Java, I've grown to love http://jdbi.org/. JDBI has a lot of features that are convenient (e.g. auto-mapping of columns to a POJO), but synthesizes DAOs for you from interfaces annotated with SQL queries, e.g.

  @RegisterMapperFactory(BeanMapperFactory.class)
  public interface TripDAO {
      @SqlQuery("SELECT trip_start AS start, MAX(timestamp) AS end FROM location_updates WHERE trip_start = :start GROUP BY trip_start ORDER BY trip_start DESC")
      public Trip trip(@Bind("start") Date tripId);
  }
And allows you to plug in providers for mixing in Optional types, PGgeometries, whatever you can fit into an interface.
parent Xorlev 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton