tk.mybatis.mapper.annotation.KeySql Java Examples

The following examples show how to use tk.mybatis.mapper.annotation.KeySql. 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: DefaultEntityResolve.java    From Mapper with 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));
    }
}