style: code format

This commit is contained in:
开源海哥 2023-10-08 18:49:13 +08:00
parent c5fb1fbea8
commit bc6694a8a6
2 changed files with 9 additions and 9 deletions

View File

@ -49,6 +49,7 @@ import static com.mybatisflex.core.query.QueryMethods.count;
* @author 王帅 * @author 王帅
* @author yangs * @author yangs
* @author lhzsdnu * @author lhzsdnu
* @author 王超
*/ */
@SuppressWarnings({"varargs", "unchecked", "unused"}) @SuppressWarnings({"varargs", "unchecked", "unused"})
public interface BaseMapper<T> { public interface BaseMapper<T> {
@ -378,7 +379,6 @@ public interface BaseMapper<T> {
int updateByQuery(@Param(FlexConsts.ENTITY) T entity, @Param(FlexConsts.IGNORE_NULLS) boolean ignoreNulls, @Param(FlexConsts.QUERY) QueryWrapper queryWrapper); int updateByQuery(@Param(FlexConsts.ENTITY) T entity, @Param(FlexConsts.IGNORE_NULLS) boolean ignoreNulls, @Param(FlexConsts.QUERY) QueryWrapper queryWrapper);
// === select === // === select ===
/** /**
@ -387,7 +387,7 @@ public interface BaseMapper<T> {
* @param entity 实体对象必须包含有主键 * @param entity 实体对象必须包含有主键
* @return 实体类数据 * @return 实体类数据
*/ */
default T selectOneByEntity(T entity){ default T selectOneByEntityId(T entity) {
FlexAssert.notNull(entity, "entity can not be null"); FlexAssert.notNull(entity, "entity can not be null");
TableInfo tableInfo = TableInfoFactory.ofEntityClass(entity.getClass()); TableInfo tableInfo = TableInfoFactory.ofEntityClass(entity.getClass());
Object[] pkArgs = tableInfo.buildPkSqlArgs(entity); Object[] pkArgs = tableInfo.buildPkSqlArgs(entity);

View File

@ -300,8 +300,8 @@ public interface IService<T> {
* @param entity 实体对象必须包含有主键 * @param entity 实体对象必须包含有主键
* @return 查询结果数据 * @return 查询结果数据
*/ */
default T getOneByEntity(T entity) { default T getOneByEntityId(T entity) {
return getMapper().selectOneByEntity(entity); return getMapper().selectOneByEntityId(entity);
} }
/** /**
@ -311,8 +311,8 @@ public interface IService<T> {
* @return 查询结果数据 * @return 查询结果数据
* @apiNote 该方法会将查询结果封装为 {@link Optional} 类进行返回方便链式操作 * @apiNote 该方法会将查询结果封装为 {@link Optional} 类进行返回方便链式操作
*/ */
default Optional<T> getByEntityOpt(T entity) { default Optional<T> getByEntityIdOpt(T entity) {
return Optional.ofNullable(getOneByEntity(entity)); return Optional.ofNullable(getOneByEntityId(entity));
} }
/** /**
* <p>根据数据主键查询一条数据 * <p>根据数据主键查询一条数据