}
protected abstract InvocationHandler createInvocationHandlerWith(Method method, String database, String table);
private void scanAndMapMethodToInvacationHandlerWith(Class<?> clazz) {
final Repository repository = clazz.getAnnotation(Repository.class);
if (repository == null)
throw new IllegalArgumentException(Repository.class + " should be annotated to class: " + clazz);
final String database = repository.database();
final String table = repository.table();
Method[] methods = clazz.getMethods();
for (Method method : methods) {
InvocationHandler handler = createInvocationHandlerWith(method, database, table);
if ((handler == null)) continue; // no need to map, so skip.
invocationMap.put(method, handler);