org.apache.ibatis.annotations.InsertProvider Java Examples

The following examples show how to use org.apache.ibatis.annotations.InsertProvider. 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
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 #4
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 #5
Source File: RoleMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@InsertProvider(type = RoleSqlProvider.class, method = "insertSql")
void insert(MemAccount memAccount);
 
Example #6
Source File: InsertSelectiveMapper.java    From tk-mybatis with MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@InsertProvider(type = SqlServerProvider.class, method = "dynamicSQL")
int insertSelective(T record);
 
Example #7
Source File: UserMapper.java    From SpringbootMybatis with Apache License 2.0 4 votes vote down vote up
@InsertProvider(type=UserSqlProvider.class, method="insertSelective")
int insertSelective(User record);
 
Example #8
Source File: ServerSystemMapper.java    From maintain with MIT License 4 votes vote down vote up
@InsertProvider(type = ServerSystemSqlProvide.class, method = "insertServerSystemSql")
int insertServerSystem(ServerSystem serverSystem);
 
Example #9
Source File: VersionMapper.java    From maintain with MIT License 4 votes vote down vote up
@InsertProvider(type = VersionSqlProvide.class, method = "insertVersionSql")
int insertVersion(Version version);
 
Example #10
Source File: MemberMapper.java    From maintain with MIT License 4 votes vote down vote up
@InsertProvider(type = MemberSqlProvide.class, method = "insertMemberSql")
int insertMember(Member member);
 
Example #11
Source File: AnnotatedMapper.java    From mybaties with Apache License 2.0 4 votes vote down vote up
@InsertProvider(type=SqlProvider.class,method="insertTable3_2")
@SelectKey(statement="call next value for TestSequence", keyProperty="nameId", before=true, resultType=int.class)
int insertTable3_2(Name name);
 
Example #12
Source File: ImpPayHeadMapper.java    From maintain with MIT License 4 votes vote down vote up
@InsertProvider(type = ImpPayHeadSqlProvide.class, method = "insertPayHeadSql")
int insertPayHead(ImpPayHead impPayHead);
 
Example #13
Source File: BusListenerMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@InsertProvider(type = BusListenerSqlProvider.class, method = "insertSql")
void insert(MemBusListener memBusListener);
 
Example #14
Source File: BusProgressMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@InsertProvider(type = BusProgressSqlProvider.class, method = "insertSql")
void insert(MemBusProgress memBusProgress);
 
Example #15
Source File: BusInfoMapper.java    From Okra with Apache License 2.0 4 votes vote down vote up
@InsertProvider(type = BusInfoSqlProvider.class, method = "insertSql")
void insert(MemBusInfo memBusInfo);
 
Example #16
Source File: InsertSelectiveMapper.java    From Mapper with MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true)
@InsertProvider(type = SqlServerProvider.class, method = "dynamicSQL")
int insertSelective(T record);
 
Example #17
Source File: AnnotatedMapper.java    From mybatis with Apache License 2.0 4 votes vote down vote up
@InsertProvider(type=SqlProvider.class,method="insertTable3_2")
@SelectKey(statement="call next value for TestSequence", keyProperty="nameId", before=true, resultType=int.class)
int insertTable3_2(Name name);
 
Example #18
Source File: MysqlCrudMapper.java    From mybatis-boost with MIT License 4 votes vote down vote up
@InsertProvider(type = Save.class, method = "reserved")
int save(T entity, String... properties);
 
Example #19
Source File: BaseMapper.java    From ace with Apache License 2.0 4 votes vote down vote up
@InsertProvider(type =BaseProvider.class,method = "insert")
long insert(T t);
 
Example #20
Source File: MysqlCrudMapper.java    From mybatis-boost with MIT License 4 votes vote down vote up
@InsertProvider(type = Save.class, method = "reserved")
int saveSelective(T entity, String... properties);
 
Example #21
Source File: BaseMapper.java    From jvue-admin with MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@InsertProvider(type = SpecialProvider.class, method = "dynamicSQL")
int insertList(List<T> recordList);
 
Example #22
Source File: MysqlCrudMapper.java    From mybatis-boost with MIT License 4 votes vote down vote up
@InsertProvider(type = Save.class, method = "reserved")
int batchSave(List<T> entity, String... properties);
 
Example #23
Source File: MysqlCrudMapper.java    From mybatis-boost with MIT License 4 votes vote down vote up
@InsertProvider(type = Replace.class, method = "reserved")
int batchReplaceSelective(List<T> entity, String... properties);
 
Example #24
Source File: MysqlCrudMapper.java    From mybatis-boost with MIT License 4 votes vote down vote up
@InsertProvider(type = Replace.class, method = "reserved")
int batchReplace(List<T> entity, String... properties);
 
Example #25
Source File: MysqlCrudMapper.java    From mybatis-boost with MIT License 4 votes vote down vote up
@InsertProvider(type = Replace.class, method = "reserved")
int replaceSelective(T entity, String... properties);
 
Example #26
Source File: MysqlCrudMapper.java    From mybatis-boost with MIT License 4 votes vote down vote up
@InsertProvider(type = Replace.class, method = "reserved")
int replace(T entity, String... properties);
 
Example #27
Source File: MysqlCrudMapper.java    From mybatis-boost with MIT License 4 votes vote down vote up
@InsertProvider(type = Save.class, method = "reserved")
int batchSaveSelective(List<T> entity, String... properties);
 
Example #28
Source File: InsertSelectiveMapper.java    From Mapper with MIT License 2 votes vote down vote up
/**
 * 保存一个实体,null的属性不会保存,会使用数据库默认值
 *
 * @param record
 * @return
 */
@InsertProvider(type = BaseInsertProvider.class, method = "dynamicSQL")
int insertSelective(T record);
 
Example #29
Source File: PgBaseMapper.java    From jvue-admin with MIT License 2 votes vote down vote up
/**
 * 保存一个实体,null的属性不会保存,会使用数据库默认值
 *
 * @param record
 * @return
 */
@Options(useGeneratedKeys = true, keyColumn = "id", keyProperty = "id")
@InsertProvider(type = BaseInsertProvider.class, method = "dynamicSQL")
int insertSelective(T record);
 
Example #30
Source File: InsertUseGeneratedKeysMapper.java    From Mapper with MIT License 2 votes vote down vote up
/**
 * 插入数据,限制为实体包含`id`属性并且必须为自增列,实体配置的主键策略无效
 *
 * @param record
 * @return
 */
@Options(useGeneratedKeys = true)
@InsertProvider(type = SpecialProvider.class, method = "dynamicSQL")
int insertUseGeneratedKeys(T record);