Java Code Examples for tk.mybatis.mapper.annotation.KeySql

The following examples show how to use tk.mybatis.mapper.annotation.KeySql. These examples are extracted from open source projects. 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: Mapper   Source File:    License: MIT License 5 votes vote down vote up
 * 处理主键策略
 * @param entityTable
 * @param field
 * @param entityColumn
protected void processKeyGenerator(EntityTable entityTable, EntityField field, EntityColumn entityColumn) {
    //KeySql 优先级最高
    if (field.isAnnotationPresent(KeySql.class)) {
        processKeySql(entityTable, entityColumn, field.getAnnotation(KeySql.class));
    } else if (field.isAnnotationPresent(GeneratedValue.class)) {
        //执行 sql - selectKey
        processGeneratedValue(entityTable, entityColumn, field.getAnnotation(GeneratedValue.class));