private Object instantiate(Class<?> clazz) {

        try {
            Object instance = clazz.newInstance();

            for (ExtendedField field : DaoUtils.getAllFieldsWithSuperclasses(clazz)) {

                if (field.hasEntityMapping() && field.isCascadingLoad()) {

                    switch (field.getEntityMapping()) {
                    case MANY_TO_MANY:
                    case MANY_TO_ONE:
                        field.setValue(instance, new ArrayList<Object>());

                        break;

                    default:

                        // Nothing to do here
                        break;
                    }
                }
            }

            return instance;
        } catch (Exception e) {
            throw new DBException("could not create instance of class '"
                + clazz + "'", e);
        }
    }