defaultbooleansaveOrUpdate(T entity, Wrapper<T> updateWrapper) { returnthis.update(entity, updateWrapper) || this.saveOrUpdate(entity); } @Transactional( rollbackFor = {Exception.class} ) publicbooleansaveOrUpdate(T entity) { if (null == entity) { returnfalse; } else { TableInfotableInfo= TableInfoHelper.getTableInfo(this.entityClass); Assert.notNull(tableInfo, "error: can not execute. because can not find cache of TableInfo for entity!", newObject[0]); StringkeyProperty= tableInfo.getKeyProperty(); Assert.notEmpty(keyProperty, "error: can not execute. because can not find column for id from entity!", newObject[0]); ObjectidVal= tableInfo.getPropertyValue(entity, tableInfo.getKeyProperty()); return !StringUtils.checkValNull(idVal) && !Objects.isNull(this.getById((Serializable)idVal)) ? this.updateById(entity) : this.save(entity); } }