No Dialect mapping for JDBC type: -4

Posted on Leave a commentPosted in Uncategorized

Yet another fun day with hibernate. While working on ResourcePhaseListener for JSF attachment problem I run into following problem while trying to retrieve BLOB from MySQL db. org.hibernate.MappingException: No Dialect mapping for JDBC type: -4 No Dialect mapping for JDBC type: -4org.hibernate.MappingException: No Dialect mapping for JDBC type: -4 No Dialect mapping for JDBC type: […]

Modulo based counters

Posted on Leave a commentPosted in Uncategorized

Sometimes we need counters that wrap around at certain intervals ex: 1,2,3,1,2,3,1,2,3 One way of doing this would be to increment our ‘counter’ and then reset it when it reaches our number int N = 3; int counter = 0; if (counter == N){ counter = 0; } counter++;int N = 3; int counter = […]