public static String getTableName(Class<?> mainObjectclass) {

        if (Entity.class.equals(mainObjectclass)) {
            throw new DBException("no tablemapping for '" + mainObjectclass + "'");
        }

        if (mainObjectclass.isAnnotationPresent(Table.class)) {
            return getTableNameInClass(mainObjectclass);
        }

        return getTableName(mainObjectclass.getSuperclass());
    }