本文整理匯總了Java中org.apache.ibatis.annotations.Update類的典型用法代碼示例。如果您正苦於以下問題:Java Update類的具體用法?Java Update怎麽用?Java Update使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Update類屬於org.apache.ibatis.annotations包,在下文中一共展示了Update類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSqlCommandType
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
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));
}
示例2: createIfNotExistsTable
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
@Update("create table if not exists ${tableName}("
+ "id bigint not null,"
+ "IntVersion varchar(60),"
+ "AlarmUniqueId varchar(60),"
+ "NeName varchar(60),"
+ "SystemName varchar(60),"
+ "EquipmentType varchar(60),"
+ "Vendor varchar(60),"
+ "LocateNeName varchar(60),"
+ "LocateNeType varchar(60),"
+ "LocateInfo varchar(60),"
+ "EventTime varchar(60),"
+ "CancelTime varchar(60),"
+ "AlarmType varchar(60),"
+ "VendorAlarmType varchar(60),"
+ "VendorSeverity varchar(60),"
+ "VendorAlarmId varchar(60),"
+ "AlarmStatus varchar(60),"
+ "AlarmTitle varchar(200),"
+ "ProbableCauseTxt varchar(200),"
+ "AlarmText varchar(200),"
+ "job varchar(20),"
+ "instance varchar(20),"
+ "primary key(id)) character set='utf8'"
)
public void createIfNotExistsTable(@Param("tableName")String tableName);
示例3: batchUpdate
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
/**
* {@link AccountImportForm.ExistPolicy}
*/
@Update("<script>"
+ "update users u join"
+ "<foreach item='item' index='index' collection='accounts' open='(' separator='union' close=')'>"
+ "<if test='index==0'>(select #{item.id} id,#{item.password} password,#{item.nick} nick,#{item.school} school,#{item.email} email)</if>"
+ "<if test='index!=0'>(select #{item.id},#{item.password},#{item.nick},#{item.school},#{item.email})</if>"
+ "</foreach>"
+ "t on u.user_id=t.id"
+ "<set>"
+ "<if test='(mask&1)!=0'>u.disabled=false,</if>"
+ "<if test='(mask&2)!=0'>u.password=t.password,</if>"
+ "<if test='(mask&4)!=0'>"
+ "u.nick=t.nick,u.school=t.school,u.email=nullif(t.email,''),"
+ "</if>"
+ "modified_time=now()"
+ "</set>"
+ "</script>")
int batchUpdate(@Param("accounts") List<Account> accounts, @Param("mask") int mask);
示例4: update
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
@CacheEvict(value = Constants.Cache.LANGUAGE, allEntries = true)
@Update("<script>update language "
+ "<set>"
+ "<if test='param2.id!=null'>id=#{param2.id},</if>"
+ "<if test='param2.name!=null'>name=#{param2.name},</if>"
+ "<if test='param2.sourceExtension!=null'>source_extension=#{param2.sourceExtension},</if>"
+ "<if test='param2.compileCommand!=null'>compile_command=#{param2.compileCommand},</if>"
+ "<if test='param2.executeCommand!=null'>execute_command=#{param2.executeCommand},</if>"
+ "<if test='param2.executableExtension!=null'>executable_extension=#{param2.executableExtension},</if>"
+ "<if test='param2.timeFactor!=null'>time_factor=#{param2.timeFactor},</if>"
+ "<if test='param2.extMemory!=null'>ext_memory=#{param2.extMemory},</if>"
+ "<if test='param2.description!=null'>description=#{param2.description},</if>"
+ "<if test='param2.disabled!=null'>disabled=#{param2.disabled},</if>"
+ "</set> where id=#{param1}"
+ "</script>")
long update(long id, Language language);
示例5: MapperAnnotationBuilder
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
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);
}
示例6: getSqlCommandType
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
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));
}
示例7: MybatisMapperAnnotationBuilder
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
public MybatisMapperAnnotationBuilder(Configuration configuration, Class<?> type) {
// 執行父類
super(configuration, 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);
}
示例8: createTable
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
@Update("CREATE TABLE IF NOT EXISTS `tb_product` (\n" +
" `pdt_id` varchar(50) NOT NULL DEFAULT '' COMMENT '產品貨號',\n" +
" `pdt_name` varchar(100) NOT NULL DEFAULT '' COMMENT '產品名稱',\n" +
" `pdt_color` varchar(20) NOT NULL DEFAULT '0' COMMENT '產品顏色',\n" +
" `pdt_counts` varchar(100) NOT NULL DEFAULT '' COMMENT '產品庫存',\n" +
" `pdt_cost` double(20,2) NOT NULL DEFAULT '0.00' COMMENT '成本價',\n" +
" `pdt_price` float(11,2) NOT NULL DEFAULT '0.00' COMMENT '標價',\n" +
" `pdt_total` double(20,2) NOT NULL DEFAULT '0.00' COMMENT '庫存總數',\n" +
" `pdt_comment` text COMMENT '備注',\n" +
" `total_rmb` double(20,2) NOT NULL DEFAULT '0.00' COMMENT '庫存總價值',\n" +
" `datetime` datetime NOT NULL COMMENT '記錄時間',\n" +
" `timeLastOp` datetime NOT NULL COMMENT '最後一次操作時間',\n" +
" `flag` tinyint(3) NOT NULL DEFAULT '0' COMMENT '[0]有效數據 [1]廢棄的',\n" +
" PRIMARY KEY (`pdt_id`),\n" +
" UNIQUE KEY `pdt_id` (`pdt_id`)\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8;")
void createTable();
示例9: updateByPrimaryKey
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table SQLTOOL_METADATA
*
* @mbggenerated
*/
@Update({
"update SQLTOOL_METADATA",
"set SQL_TYPE = #{sqlType,jdbcType=VARCHAR},",
"NAME = #{name,jdbcType=VARCHAR},",
"DESCRIPTION = #{description,jdbcType=VARCHAR},",
"OWNED_BY = #{ownedBy,jdbcType=VARCHAR},",
"PUBLISHED_FLG = #{publishedFlg,jdbcType=INTEGER},",
"REGISTERED_AT = #{registeredAt,jdbcType=TIMESTAMP},",
"UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP},",
"CREATED_AT = #{createdAt,jdbcType=TIMESTAMP},",
"LOCK_VERSION = #{lockVersion,jdbcType=INTEGER},",
"DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}",
"where ID = #{id,jdbcType=INTEGER}"
})
int updateByPrimaryKey(SqltoolMetadata record);
示例10: updateByPrimaryKey
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table MAIL_LOG
*
* @mbggenerated
*/
@Update({
"update MAIL_LOG",
"set LAUNCHED_BY = #{launchedBy,jdbcType=VARCHAR},",
"LAUNCHED_AT = #{launchedAt,jdbcType=TIMESTAMP},",
"MAIL_STATUS = #{mailStatus,jdbcType=INTEGER},",
"MESSAGE_NAME = #{messageName,jdbcType=VARCHAR},",
"SCHEDULED_AT = #{scheduledAt,jdbcType=TIMESTAMP},",
"SENT_AT = #{sentAt,jdbcType=TIMESTAMP},",
"FROM_ADDR = #{fromAddr,jdbcType=VARCHAR},",
"SUBJECT = #{subject,jdbcType=VARCHAR},",
"BODY = #{body,jdbcType=VARCHAR},",
"UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP},",
"CREATED_AT = #{createdAt,jdbcType=TIMESTAMP},",
"LOCK_VERSION = #{lockVersion,jdbcType=INTEGER},",
"DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}",
"where ID = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(MailLog record);
示例11: updateByPrimaryKey
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table SQLTOOL_CLAUSE
*
* @mbggenerated
*/
@Update({
"update SQLTOOL_CLAUSE",
"set DATABASE_NAME = #{databaseName,jdbcType=VARCHAR},",
"SELECT_CLAUSE = #{selectClause,jdbcType=VARCHAR},",
"FROM_CLAUSE = #{fromClause,jdbcType=VARCHAR},",
"WHERE_CLAUSE = #{whereClause,jdbcType=VARCHAR},",
"GROUP_BY_CLAUSE = #{groupByClause,jdbcType=VARCHAR},",
"HAVING_CLAUSE = #{havingClause,jdbcType=VARCHAR},",
"ORDER_BY_CLAUSE = #{orderByClause,jdbcType=VARCHAR},",
"PARAM_MAP = #{paramMap,jdbcType=VARCHAR},",
"UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP},",
"CREATED_AT = #{createdAt,jdbcType=TIMESTAMP},",
"LOCK_VERSION = #{lockVersion,jdbcType=INTEGER},",
"DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}",
"where ID = #{id,jdbcType=INTEGER}"
})
int updateByPrimaryKey(SqltoolClause record);
示例12: updateByPrimaryKey
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ASYNC_PROCESS_FILE
*
* @mbggenerated
*/
@Update({
"update ASYNC_PROCESS_FILE",
"set ASYNC_ID = #{asyncId,jdbcType=BIGINT},",
"HANDLER_NAME = #{handlerName,jdbcType=VARCHAR},",
"PARAM_NAME = #{paramName,jdbcType=VARCHAR},",
"ORIGINAL_FILENAME = #{originalFilename,jdbcType=VARCHAR},",
"CONTENT_TYPE = #{contentType,jdbcType=VARCHAR},",
"FILE_SIZE = #{fileSize,jdbcType=BIGINT},",
"UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP},",
"CREATED_AT = #{createdAt,jdbcType=TIMESTAMP},",
"LOCK_VERSION = #{lockVersion,jdbcType=INTEGER},",
"DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}",
"where ID = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(AsyncProcessFile record);
示例13: updateByPrimaryKey
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ASYNC_PROCESS
*
* @mbggenerated
*/
@Update({
"update ASYNC_PROCESS",
"set LAUNCHED_BY = #{launchedBy,jdbcType=VARCHAR},",
"DESCRIPTION = #{description,jdbcType=VARCHAR},",
"ASYNC_TYPE = #{asyncType,jdbcType=VARCHAR},",
"ASYNC_STATUS = #{asyncStatus,jdbcType=VARCHAR},",
"REGISTERED_AT = #{registeredAt,jdbcType=TIMESTAMP},",
"LAUNCHED_AT = #{launchedAt,jdbcType=TIMESTAMP},",
"STARTED_AT = #{startedAt,jdbcType=TIMESTAMP},",
"FINISHED_AT = #{finishedAt,jdbcType=TIMESTAMP},",
"UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP},",
"CREATED_AT = #{createdAt,jdbcType=TIMESTAMP},",
"LOCK_VERSION = #{lockVersion,jdbcType=INTEGER},",
"DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}",
"where ID = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(AsyncProcess record);
示例14: updateByPrimaryKey
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TODO
*
* @mbggenerated
*/
@Update({
"update TODO",
"set POSTED_BY = #{postedBy,jdbcType=VARCHAR},",
"POSTED_AT = #{postedAt,jdbcType=TIMESTAMP},",
"DUE_DT = #{dueDt,jdbcType=DATE},",
"DONE_AT = #{doneAt,jdbcType=TIMESTAMP},",
"DONE_FLG = #{doneFlg,jdbcType=INTEGER},",
"DESCRIPTION = #{description,jdbcType=VARCHAR},",
"UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP},",
"CREATED_AT = #{createdAt,jdbcType=TIMESTAMP},",
"LOCK_VERSION = #{lockVersion,jdbcType=INTEGER},",
"DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}",
"where ID = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(Todo record);
示例15: updateByPrimaryKey
import org.apache.ibatis.annotations.Update; //導入依賴的package包/類
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table MAIL_LOG
*
* @mbggenerated
*/
@Update({
"update MAIL_LOG",
"set LAUNCHED_BY = #{launchedBy,jdbcType=VARCHAR},",
"LAUNCHED_AT = #{launchedAt,jdbcType=TIMESTAMP},",
"MAIL_STATUS = #{mailStatus,jdbcType=INTEGER},",
"MESSAGE_NAME = #{messageName,jdbcType=VARCHAR},",
"SCHEDULED_AT = #{scheduledAt,jdbcType=TIMESTAMP},",
"SENT_AT = #{sentAt,jdbcType=TIMESTAMP},",
"FROM_ADDR = #{fromAddr,jdbcType=VARCHAR},",
"REPLY_TO_ADDR = #{replyToAddr,jdbcType=VARCHAR},",
"SUBJECT = #{subject,jdbcType=VARCHAR},",
"BODY = #{body,jdbcType=VARCHAR},",
"UPDATED_AT = #{updatedAt,jdbcType=TIMESTAMP},",
"CREATED_AT = #{createdAt,jdbcType=TIMESTAMP},",
"LOCK_VERSION = #{lockVersion,jdbcType=INTEGER},",
"DELETED_FLG = #{deletedFlg,jdbcType=INTEGER}",
"where ID = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(MailLog record);