org.apache.ibatis.annotations.Options Java Examples

The following examples show how to use org.apache.ibatis.annotations.Options. 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 Project: voj   Author: hzxie   File: SubmissionMapper.java    License: GNU General Public License v3.0 6 votes vote down vote up
/**
 * 通过评测记录唯一标识符获取试题对象.
 * @param submissionId - 评测记录的唯一标识符
 * @return 一个评测记录对象
 */
@Select("SELECT * FROM voj_submissions WHERE submission_id = #{submissionId}")
@Options(useCache = true)
@Results({
	@Result(property = "submissionId", column = "submission_id"),
	@Result(property = "problem", column = "problem_id", javaType = Problem.class, one = @One(select="org.verwandlung.voj.judger.mapper.ProblemMapper.getProblem")),
	@Result(property = "uid", column = "uid"),
	@Result(property = "language", column = "language_id", javaType=Language.class, one = @One(select="org.verwandlung.voj.judger.mapper.LanguageMapper.getLanguageUsingId")),
	@Result(property = "submitTime", column = "submission_submit_time"),
	@Result(property = "executeTime", column = "submission_execute_time"),
	@Result(property = "usedTime", column = "submission_used_time"),
	@Result(property = "usedMemory", column = "submission_used_memory"),
	@Result(property = "judgeResultSlug", column = "submission_judge_result"),
	@Result(property = "judgeScore", column = "submission_judge_score"),
	@Result(property = "judgeLog", column = "submission_judge_log"),
	@Result(property = "code", column = "submission_code"),
})
Submission getSubmission(@Param("submissionId") long submissionId);
 
Example #2
Source Project: voj   Author: hzxie   File: ProblemMapper.java    License: GNU General Public License v3.0 6 votes vote down vote up
/**
 * 通过试题唯一标识符获取试题对象.
 * @param problemId - 试题的唯一标识符
 * @return 一个试题对象
 */
@Select("SELECT * FROM voj_problems WHERE problem_id = #{problemId}")
@Options(useCache = true)
@Results({
	 @Result(property = "problemId", column = "problem_id"),
	 @Result(property = "isPublic", column = "problem_is_public"),
	 @Result(property = "problemName", column = "problem_name"),
	 @Result(property = "totalSubmission", column = "total_submission"),
	 @Result(property = "acceptedSubmission", column = "accepted_submission"),
	 @Result(property = "timeLimit", column = "problem_time_limit"),
	 @Result(property = "memoryLimit", column = "problem_memory_limit"),
	 @Result(property = "description", column = "problem_description"),
	 @Result(property = "inputFormat", column = "problem_input_format"),
	 @Result(property = "outputFormat", column = "problem_output_format"),
	 @Result(property = "sampleInput", column = "problem_sample_input"),
	 @Result(property = "sampleOutput", column = "problem_sample_output"),
	 @Result(property = "hint", column = "problem_hint")
})
Problem getProblem(@Param("problemId") long problemId);
 
Example #3
Source Project: mybatis   Author: tuguangquan   File: InsertMapper.java    License: Apache License 2.0 5 votes vote down vote up
@Insert({
    "insert into mbtest.test_identity",
    "(first_name, last_name)",
    "values(#{firstName,jdbcType=VARCHAR}, #{lastName,jdbcType=VARCHAR})"
})
@Options(keyProperty="id", useGeneratedKeys=true, keyColumn="name_id")
int insertNameAnnotated(Name name);
 
Example #4
Source Project: taskana   Author: Taskana   File: TaskMapper.java    License: Apache License 2.0 5 votes vote down vote up
@Insert(
    "INSERT INTO TASK(ID, EXTERNAL_ID, CREATED, CLAIMED, COMPLETED, MODIFIED, PLANNED, DUE, NAME, CREATOR, DESCRIPTION, NOTE, PRIORITY, STATE,  CLASSIFICATION_CATEGORY, CLASSIFICATION_KEY, CLASSIFICATION_ID, WORKBASKET_ID, WORKBASKET_KEY, DOMAIN, BUSINESS_PROCESS_ID, PARENT_BUSINESS_PROCESS_ID, OWNER, POR_COMPANY, "
        + "POR_SYSTEM, POR_INSTANCE, POR_TYPE, POR_VALUE, IS_READ, IS_TRANSFERRED, CALLBACK_INFO, CALLBACK_STATE, CUSTOM_ATTRIBUTES, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, "
        + "CUSTOM_9, CUSTOM_10, CUSTOM_11,  CUSTOM_12,  CUSTOM_13,  CUSTOM_14,  CUSTOM_15,  CUSTOM_16 ) "
        + "VALUES(#{id},#{externalId}, #{created}, #{claimed}, #{completed}, #{modified}, #{planned}, #{due}, #{name}, #{creator}, #{description}, #{note}, #{priority}, #{state}, #{classificationSummary.category}, "
        + "#{classificationSummary.key}, #{classificationSummary.id}, #{workbasketSummary.id}, #{workbasketSummary.key}, #{workbasketSummary.domain}, #{businessProcessId}, "
        + "#{parentBusinessProcessId}, #{owner}, #{primaryObjRef.company}, #{primaryObjRef.system}, #{primaryObjRef.systemInstance}, #{primaryObjRef.type}, #{primaryObjRef.value}, "
        + "#{isRead}, #{isTransferred}, #{callbackInfo,jdbcType=CLOB,javaType=java.util.Map,typeHandler=pro.taskana.common.internal.persistence.MapTypeHandler}, #{callbackState}, "
        + "#{customAttributes,jdbcType=CLOB,javaType=java.util.Map,typeHandler=pro.taskana.common.internal.persistence.MapTypeHandler}, "
        + "#{custom1}, #{custom2}, #{custom3}, #{custom4}, #{custom5}, #{custom6}, #{custom7}, #{custom8}, #{custom9}, #{custom10}, "
        + "#{custom11}, #{custom12}, #{custom13}, #{custom14}, #{custom15},  #{custom16})")
@Options(keyProperty = "id", keyColumn = "ID")
void insert(TaskImpl task);
 
Example #5
Source Project: mybaties   Author: shurun19851206   File: InsertMapper.java    License: Apache License 2.0 5 votes vote down vote up
@Insert({
    "insert into mbtest.test_identity",
    "(first_name, last_name)",
    "values(#{firstName,jdbcType=VARCHAR}, #{lastName,jdbcType=VARCHAR})"
})
@Options(keyProperty="id", useGeneratedKeys=true, keyColumn="name_id")
int insertNameAnnotated(Name name);
 
Example #6
Source Project: voj   Author: hzxie   File: UserMapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * 通过用户名获取用户对象.
 * @param username - 用户名
 * @return 预期的用户对象或空引用
 */
@Select("SELECT * FROM voj_users WHERE username = #{username}")
@Options(useCache = false)
@Results(value = {
	@Result(property = "userGroup", column = "user_group_id", javaType = UserGroup.class, one = @One(select="org.verwandlung.voj.judger.mapper.UserGroupMapper.getUserGroupUsingId")),
	@Result(property = "preferLanguage", column = "prefer_language_id", javaType = Language.class, one = @One(select="org.verwandlung.voj.judger.mapper.LanguageMapper.getLanguageUsingId"))
})
User getUserUsingUsername(@Param("username") String username);
 
Example #7
Source Project: voj   Author: hzxie   File: CheckpointMapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * 获取某个试题的全部测试点.
 * @param problemId - 试题的唯一标识符
 * @return 某个试题的全部测试点
 */
@Select("SELECT * FROM voj_problem_checkpoints WHERE problem_id = #{problemId}")
@Options(useCache = true)
@Results({
	@Result(property = "problemId", column = "problem_id"),
	@Result(property = "checkpointId", column = "checkpoint_id"),
	@Result(property = "isExactlyMatch", column = "checkpoint_exactly_match"),
	@Result(property = "score", column = "checkpoint_score"),
	@Result(property = "input", column = "checkpoint_input"),
	@Result(property = "output", column = "checkpoint_output"),
})
List<Checkpoint> getCheckpointsUsingProblemId(@Param("problemId") long problemId);
 
Example #8
Source Project: voj   Author: hzxie   File: LanguageMapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * 通过编程语言的唯一标识符获取编程语言对象.
 * @param languageId - 编程语言的唯一标识符
 * @return 预期的编程语言对象或空引用
 */
@Select("SELECT * FROM voj_languages WHERE language_id = #{languageId}")
@Options(useCache = true)
@Results({
	 @Result(property = "languageId", column = "language_id"),
	 @Result(property = "languageSlug", column = "language_slug"),
	 @Result(property = "languageName", column = "language_name"),
	 @Result(property = "compileCommand", column = "language_compile_command"),
	 @Result(property = "runCommand", column = "language_run_command"),
})
Language getLanguageUsingId(@Param("languageId") int languageId);
 
Example #9
Source Project: voj   Author: hzxie   File: LanguageMapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * 通过编程语言的唯一英文缩写获取编程语言对象.
 * @param languageSlug - 编程语言的唯一英文缩写
 * @return 预期的编程语言对象或空引用
 */
@Select("SELECT * FROM voj_languages WHERE language_slug = #{languageSlug}")
@Options(useCache = true)
@Results({
	 @Result(property = "languageId", column = "language_id"),
	 @Result(property = "languageSlug", column = "language_slug"),
	 @Result(property = "languageName", column = "language_name"),
	 @Result(property = "compileCommand", column = "language_compile_command"),
	 @Result(property = "runCommand", column = "language_run_command"),
})
Language getLanguageUsingSlug(@Param("languageSlug") String languageSlug);
 
Example #10
Source Project: voj   Author: hzxie   File: JudgeResultMapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * 通过评测结果的唯一标识符获取评测结果对象.
 * @return 预期的评测结果对象或空引用
 */
@Select("SELECT * FROM voj_judge_results")
@Options(useCache = true)
@Results({
	 @Result(property = "judgeResultId", column = "judge_result_id"),
	 @Result(property = "judgeResultSlug", column = "judge_result_slug"),
	 @Result(property = "judgeResultName", column = "judge_result_name")
})
List<JudgeResult> getAllJudgeResults();
 
Example #11
Source Project: voj   Author: hzxie   File: JudgeResultMapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * 通过评测结果的唯一英文缩写获取评测结果对象.
 * @param judgeResultSlug - 评测结果的唯一英文缩写
 * @return 预期的评测结果对象或空引用
 */
@Select("SELECT * FROM voj_judge_results WHERE judge_result_slug = #{judgeResultSlug}")
@Options(useCache = true)
@Results({
	 @Result(property = "judgeResultId", column = "judge_result_id"),
	 @Result(property = "judgeResultSlug", column = "judge_result_slug"),
	 @Result(property = "judgeResultName", column = "judge_result_name")
})
JudgeResult getJudgeResultUsingSlug(@Param("judgeResultSlug") String judgeResultSlug);
 
Example #12
Source Project: voj   Author: hzxie   File: UserGroupMapper.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * 通过用户组的唯一标识符获取用户组对象.
 * @param userGroupId - 用户组的唯一标识符
 * @return 预期的用户组对象或空引用
 */
@Select("SELECT * FROM voj_user_groups WHERE user_group_id = #{userGroupId}")
@Options(useCache = true)
@Results({
	 @Result(property = "userGroupId", column = "user_group_id"),
	 @Result(property = "userGroupSlug", column = "user_group_slug"),
	 @Result(property = "userGroupName", column = "user_group_name")
})
UserGroup getUserGroupUsingId(@Param("userGroupId") int userGroupId);
 
Example #13
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SmsDao.java    License: Apache License 2.0 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_sms(phone, signName, templateCode, params, day, createTime, updateTime) "
		+ "values(#{phone}, #{signName}, #{templateCode}, #{params}, #{day}, #{createTime}, #{updateTime})")
int save(Sms sms);
 
Example #14
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysPermissionDao.java    License: Apache License 2.0 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_permission(permission, name, createTime, updateTime) values(#{permission}, #{name}, #{createTime}, #{createTime})")
int save(SysPermission sysPermission);
 
Example #15
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysUserDao.java    License: Apache License 2.0 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_user(username, password, nickname, headImgUrl, phone, sex, enabled, type, createTime, updateTime) "
		+ "values(#{username}, #{password}, #{nickname}, #{headImgUrl}, #{phone}, #{sex}, #{enabled}, #{type}, #{createTime}, #{updateTime})")
int save(SysUser sysUser);
 
Example #16
Source Project: open-capacity-platform   Author: open-capacity-platform   File: SysRoleDao.java    License: Apache License 2.0 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_role(code, name, createTime, updateTime) values(#{code}, #{name}, #{createTime}, #{createTime})")
int save(SysRole sysRole);
 
Example #17
Source Project: cloud-service   Author: allenyiwen   File: MailDao.java    License: MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into t_mail(userId, username, toEmail, subject, content, status, createTime, updateTime) values(#{userId}, #{username}, #{toEmail}, #{subject}, #{content}, #{status}, #{createTime}, #{updateTime})")
int save(Mail mail);
 
Example #18
Source Project: mybatis   Author: tuguangquan   File: SPMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("{call sptest.getname(#{id,jdbcType=INTEGER,mode=IN})}")
@Results({ @Result(column = "ID", property = "id"), @Result(column = "FIRST_NAME", property = "firstName"), @Result(column = "LAST_NAME", property = "lastName") })
@Options(statementType = StatementType.CALLABLE)
Name getNameAnnotated(Integer id);
 
Example #19
Source Project: cloud-service   Author: allenyiwen   File: SysPermissionDao.java    License: MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_permission(permission, name, createTime, updateTime) values(#{permission}, #{name}, #{createTime}, #{createTime})")
int save(SysPermission sysPermission);
 
Example #20
Source Project: cloud-service   Author: allenyiwen   File: AppUserDao.java    License: MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into app_user(username, password, nickname, headImgUrl, phone, sex, enabled, type, createTime, updateTime) "
		+ "values(#{username}, #{password}, #{nickname}, #{headImgUrl}, #{phone}, #{sex}, #{enabled}, #{type}, #{createTime}, #{updateTime})")
int save(AppUser appUser);
 
Example #21
Source Project: cloud-service   Author: allenyiwen   File: SysRoleDao.java    License: MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into sys_role(code, name, createTime, updateTime) values(#{code}, #{name}, #{createTime}, #{createTime})")
int save(SysRole sysRole);
 
Example #22
Source Project: cloud-service   Author: allenyiwen   File: WechatDao.java    License: MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("insert into t_wechat(openid, unionid, userId, app, nickname, sex, province, city, country, headimgurl, createTime, updateTime) " +
        "values(#{openid}, #{unionid}, #{userId}, #{app}, #{nickname}, #{sex}, #{province}, #{city}, #{country}, #{headimgurl}, #{createTime}, #{updateTime})")
int save(WechatUserInfo info);
 
Example #23
Source Project: pre   Author: LiHaodong888   File: SysRoleMapper.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Insert("insert into sys_role (role_name,role_code,role_desc,ds_type,ds_scope) values (#{roleName}, #{roleCode},#{roleDesc},#{dsType},#{dsScope})")
@Options(useGeneratedKeys=true, keyProperty="roleId", keyColumn="role_id")
Boolean insertRole(SysRole sysRole);
 
Example #24
Source Project: pre   Author: LiHaodong888   File: SysUserMapper.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Insert("insert into sys_user (username,password,dept_id,job_id,phone,email,avatar,lock_flag) values (#{username},#{password},#{deptId},#{jobId},#{phone},#{email},#{avatar},#{lockFlag})")
@Options(useGeneratedKeys = true, keyProperty = "userId", keyColumn = "user_id")
boolean insertUser(SysUser sysUser);
 
Example #25
Source Project: opscenter   Author: appjishu   File: MethodMapper.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * 插入功能
 */
@Insert("insert ingrid_method(methodName,document,poolName,outParam,sqlType,rsStatus)values(#{methodBean.methodName},#{methodBean.document},#{methodBean.poolName},#{methodBean.outParam},#{methodBean.sqlType},#{methodBean.rsStatus})")
@Options(useGeneratedKeys = true, keyProperty = "methodBean.methodId")
public void insertMethodBean(@Param("method") MethodBean methodBean);
 
Example #26
Source Project: jvue-admin   Author: ccfish86   File: BaseMapper.java    License: 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 #27
Source Project: Mapper   Author: abel533   File: InsertSelectiveMapper.java    License: MIT License 4 votes vote down vote up
@Options(useGeneratedKeys = true)
@InsertProvider(type = SqlServerProvider.class, method = "dynamicSQL")
int insertSelective(T record);
 
Example #28
Source Project: pulsar-manager   Author: apache   File: RoleBindingMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("INSERT INTO role_binding (name, description, user_id, role_id) " +
        "VALUES (#{name}, #{description}, #{userId}, #{roleId})")
@Options(useGeneratedKeys=true, keyProperty="roleBindingId", keyColumn="role_binding_id")
long insert(RoleBindingEntity roleBindingEntity);
 
Example #29
Source Project: mybatis   Author: tuguangquan   File: SPMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("{call sptest.getnamesanditems()}")
@ResultMap("nameResult,itemResult")
@Options(statementType = StatementType.CALLABLE)
List<List<?>> getNamesAndItemsAnnotatedWithXMLResultMap();
 
Example #30
Source Project: pulsar-manager   Author: apache   File: UsersMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Insert("INSERT INTO users (access_token, name, description, email, phone_number" +
        ", location, company, expire, password)" +
        "VALUES (#{accessToken}, #{name}, #{description}, #{email}, #{phoneNumber}" +
        ", #{location}, #{company}, #{expire}, #{password})")
@Options(useGeneratedKeys=true, keyProperty="userId", keyColumn="user_id")
long save(UserInfoEntity userInfoEntity);