public void remove(T entity) throws NonexistentEntityException {
        Object id = null;
        String idFieldName = "";
        for (Field field : entity.getClass().getDeclaredFields()) {
            if (field.getAnnotation(Id.class) != null)
                try {
                    if (!field.isAccessible())
                        field.setAccessible(true);
                    id = field.get(entity);
                    idFieldName = field.getName();
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
        }

        TObject object = objectJpaController.findTObject((Integer) id);
        if (object != null) {
            for (ObjectFields objectFields : object.getObjectFieldsList())
                objectFieldsJpaController.destroy(objectFields.getId());
            try {
                objectJpaController.destroy(object.getId());
            } catch (IllegalOrphanException e) {
                e.printStackTrace();
            } catch (NonexistentEntityException e) {
                e.printStackTrace();
            }
        } else
            throw new NonexistentEntityException("Unable to find entity by id = " + id);
    }