Menu

Easy to get burned by Hibernate

October 22, 2009

I got burned by Hibernate the other day. This code throws a ClassCastException; can you see what the trouble might be? return (Integer) session.createSQLQuery( “select count(*) ” + “from trades ” + “where date >= :from and date < :to”) .setParameter(“from”, converter.toString(from)) .setParameter(“to”, converter.toString(to)) .uniqueResult(); Under the covers Hibernate infers the result of the query… Read more

Unifying Type Parameters in Java

October 12, 2009

At kaChing, we’ve designed from the ground up using services. We have many servers clustered into services which respond to simple queries such as “give me Alice’s watchlist”, “buy 10,000 shares of Google for Ted” and quite often “give you $10M for inviting a friend”. At the lowest level in our platform, we’ve decomposed our… Read more