org.apache.ibatis.annotations.UpdateProvider Java Examples

The following examples show how to use org.apache.ibatis.annotations.UpdateProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MapperAnnotationBuilder.java    From mybatis with Apache License 2.0 6 votes vote down vote up
private SqlCommandType getSqlCommandType(Method method) {
  Class<? extends Annotation> type = getSqlAnnotationType(method);

  if (type == null) {
    type = getSqlProviderAnnotationType(method);

    if (type == null) {
      return SqlCommandType.UNKNOWN;
    }

    if (type == SelectProvider.class) {
      type = Select.class;
    } else if (type == InsertProvider.class) {
      type = Insert.class;
    } else if (type == UpdateProvider.class) {
      type = Update.class;
    } else if (type == DeleteProvider.class) {
      type = Delete.class;
    }
  }

  return SqlCommandType.valueOf(type.getSimpleName().toUpperCase(Locale.ENGLISH));
}
 
Example #2
Source File: MapperAnnotationBuilder.java    From mybatis with Apache License 2.0 6 votes vote down vote up
public MapperAnnotationBuilder(Configuration configuration, Class<?> type) {
  String resource = type.getName().replace('.', '/') + ".java (best guess)";
  this.assistant = new MapperBuilderAssistant(configuration, resource);
  this.configuration = configuration;
  this.type = type;

  sqlAnnotationTypes.add(Select.class);
  sqlAnnotationTypes.add(Insert.class);
  sqlAnnotationTypes.add(Update.class);
  sqlAnnotationTypes.add(Delete.class);

  sqlProviderAnnotationTypes.add(SelectProvider.class);
  sqlProviderAnnotationTypes.add(InsertProvider.class);
  sqlProviderAnnotationTypes.add(UpdateProvider.class);
  sqlProviderAnnotationTypes.add(DeleteProvider.class);
}
 
Example #3
Source File: MapperAnnotationBuilder.java    From mybaties with Apache License 2.0 6 votes vote down vote up
private SqlCommandType getSqlCommandType(Method method) {
  Class<? extends Annotation> type = getSqlAnnotationType(method);

  if (type == null) {
    type = getSqlProviderAnnotationType(method);

    if (type == null) {
      return SqlCommandType.UNKNOWN;
    }

    if (type == SelectProvider.class) {
      type = Select.class;
    } else if (type == InsertProvider.class) {
      type = Insert.class;
    } else if (type == UpdateProvider.class) {
      type = Update.class;
    } else if (type == DeleteProvider.class) {
      type = Delete.class;
    }
  }

  return SqlCommandType.valueOf(type.getSimpleName().toUpperCase(Locale.ENGLISH));
}
 
Example #4
Source File: MapperAnnotationBuilder.java    From mybaties with Apache License 2.0 6 votes vote down vote up
public MapperAnnotationBuilder(Configuration configuration, Class<?> type) {
  String resource = type.getName().replace('.', '/') + ".java (best guess)";
  this.assistant = new MapperBuilderAssistant(configuration, resource);
  this.configuration = configuration;
  this.type = type;

  sqlAnnotationTypes.add(Select.class);
  sqlAnnotationTypes.add(Insert.class);
  sqlAnnotationTypes.add(Update.class);
  sqlAnnotationTypes.add(Delete.class);

  sqlProviderAnnotationTypes.add(SelectProvider.class);
  sqlProviderAnnotationTypes.add(InsertProvider.class);
  sqlProviderAnnotationTypes.add(UpdateProvider.class);
  sqlProviderAnnotationTypes.add(DeleteProvider.class);
}
 
Example #5
Source File: ImpPayHeadMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = ImpPayHeadSqlProvide.class, method = "updateImpPayHeadSql")
Integer updateImpPayHead(ImpPayHead impPayHead);
 
Example #6
Source File: VersionMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = VersionSqlProvide.class, method = "updateVersionSql")
int updateVersion(Version version);
 
Example #7
Source File: InvtHeadMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = InvtHeadSqlProvide.class, method = "updateInvtHeadStatusSql")
Integer updateInvtHeadStatus(String headGuid, String status);
 
Example #8
Source File: InvtHeadMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = InvtHeadSqlProvide.class, method = "updateInvtStatusAndInvtNoSql")
Integer updateInvtStatusAndInvtNo(InvtHead invtHead);
 
Example #9
Source File: InvtHeadMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = InvtHeadSqlProvide.class, method = "syncInvtNoStatusSql")
Integer syncInvtNoStatus(String cusStatus, String status);
 
Example #10
Source File: ServerSystemMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = ServerSystemSqlProvide.class, method = "updateServerSystemSql")
int updateServerSystem(ServerSystem serverSystem);
 
Example #11
Source File: MemberMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = MemberSqlProvide.class, method = "updateMemberSql")
int updateMember(Member member);
 
Example #12
Source File: VeHeadMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = VeHeadSqlProvide.class, method = "syncVeENoSql")
Integer syncVeENo();
 
Example #13
Source File: VeHeadMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = VeHeadSqlProvide.class, method = "clearVeeNoSql")
Integer clearVeeNo(String veId);
 
Example #14
Source File: RoleMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type = RoleSqlProvider.class, method = "deleteSql")
void delete(long uid);
 
Example #15
Source File: RoleMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type = RoleSqlProvider.class, method = "updateSql")
MemAccount update(MemAccount memAccount);
 
Example #16
Source File: BusListenerMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type = BusListenerSqlProvider.class, method = "deleteSql")
void delete(@Param("uid") long uid, @Param("event") int event);
 
Example #17
Source File: BusProgressMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type = BusProgressSqlProvider.class, method = "updateSql")
void update(MemBusProgress memBusProgress);
 
Example #18
Source File: BusProgressMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type = BusProgressSqlProvider.class, method = "deleteSql")
void delete(@Param("uid") long uid, @Param("event") int busId);
 
Example #19
Source File: BusInfoMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type = BusInfoSqlProvider.class, method = "updateSql")
void update(MemBusInfo memBusInfo);
 
Example #20
Source File: BusInfoMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type = BusInfoSqlProvider.class, method = "deleteSql")
void delete(@Param("uid") long uid, @Param("busId") int busId);
 
Example #21
Source File: BusInfoMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type = BusInfoSqlProvider.class, method = "deleteByListSql")
void deleteBatch(@Param("uid") long uid, @Param("list") List<Integer> list);
 
Example #22
Source File: PersonalInfoMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = PersonalInfoSqlProvide.class, method = "clearErrorCountSql")
Integer clearErrorCount(String uuid);
 
Example #23
Source File: UserMapper.java    From SpringbootMybatis with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type=UserSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(User record);
 
Example #24
Source File: UserMapper.java    From SpringbootMybatis with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type=UserSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") User record, @Param("example") UserCriteria example);
 
Example #25
Source File: UserMapper.java    From SpringbootMybatis with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type=UserSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") User record, @Param("example") UserCriteria example);
 
Example #26
Source File: PersonalInfoMapper.java    From maintain with MIT License 4 votes vote down vote up
@UpdateProvider(type = PersonalInfoSqlProvide.class, method = "clearErrorCountAllSql")
Integer clearErrorCountAll();
 
Example #27
Source File: BaseMapper.java    From ace with Apache License 2.0 4 votes vote down vote up
@UpdateProvider(type =BaseProvider.class,method = "update")
long update(T t);
 
Example #28
Source File: CommonMapper.java    From uncode-dal-all with GNU General Public License v2.0 2 votes vote down vote up
/**
 * 条件更新
 * 更新字段传入 model.params,不能为空
 * 条件传入model.QueryCriteria
 * @param model
 * @return
 */
@UpdateProvider(method = "updateByCriteria", type = SqlTemplate.class)
int updateByCriteria(Table model);
 
Example #29
Source File: InMapper.java    From BlogManagePlatform with Apache License 2.0 2 votes vote down vote up
/**
 * 通过in条件更新所有record中不为null字段,只支持一个in条件,是简单的封装
 * @param paramName 该表中的字段名(和Example不同,只能是表中字段名,不能是实体对应字段名)
 * @param params 该表中的对应字段
 * @param record 更新的数据,为null的字段将不更新
 * @author Frodez
 * @date 2019-12-25
 */
@UpdateProvider(type = InMapperProvider.class, method = "dynamicSQL")
int updateInSelective(@Param("paramName") String paramName, @Param("params") List<?> params, T record);
 
Example #30
Source File: CommonMapper.java    From uncode-dal-all with GNU General Public License v2.0 2 votes vote down vote up
/**
 * 主键更新
 * 更新字段传入 model.params,不能为空
 * 主键参数传入 model.conditions,不能为空
 * @param model
 * @return
 */
@UpdateProvider(method = "updateByPrimaryKey", type = SqlTemplate.class)
int updateByPrimaryKey(Table model);