public void updateObjectFields(Integer id, Map<String, Object> fields) throws PersistenceException {
        TObject tObject = objectJpaController.findTObject(id);
        if (tObject == null)
            throw new PersistenceException("Unable to find object " + id);

        List<ObjectFields> newObjectFields = new ArrayList<>();
        for (String name : fields.keySet()) {
            Object value = fields.get(name);
            String fieldType = value.getClass().getSimpleName().toLowerCase();
            ObjectFields newObjectField = new ObjectFields(0, name, fieldType);
            newObjectField.setObjectId(tObject);

            switch (fieldType) {
                case "integer":
                    newObjectField.setIntval((Integer) value);
                    break;
                case "long":
                    newObjectField.setLongval((Long) value);
                    break;
                case "double":
                    newObjectField.setFloatval((Double) value);
                    break;
                case "date":
                    newObjectField.setDateval((Date) value);
                    break;
                case "string":
                    newObjectField.setStrval((String) value);
                    break;
            }
//            objectFieldsJpaController.create(newObjectField);
            newObjectFields.add(newObjectField);
        }
        objectFieldsJpaController.createAll(newObjectFields);
        tObject.setVersion(tObject.getVersion() + 1);
        tObject.setUpdated(new Date());
        tObject.setObjectFieldsList(newObjectFields);

        try {
            objectJpaController.edit(tObject);
        } catch (Exception e) {
            e.printStackTrace();
            throw new PersistenceException(e.getMessage());
        }
    }