io.github.nichetoolkit.mybatis.style.DefaultUpperUnderlineStyle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mybatis-toolkit-context Show documentation
Show all versions of mybatis-toolkit-context Show documentation
Mybatis toolkit context project for Spring Boot
The newest version!
package io.github.nichetoolkit.mybatis.style;
import io.github.nichetoolkit.mybatis.MybatisField;
import io.github.nichetoolkit.mybatis.MybatisTableStyle;
import io.github.nichetoolkit.mybatis.MybatisTable;
import io.github.nichetoolkit.rice.enums.StyleType;
import io.github.nichetoolkit.rest.util.GeneralUtils;
import java.lang.reflect.Field;
/**
* DefaultUpperUnderlineStyle
* The default upper underline style class.
* @author Cyan ([email protected])
* @see io.github.nichetoolkit.mybatis.MybatisTableStyle
* @since Jdk1.8
*/
public class DefaultUpperUnderlineStyle implements MybatisTableStyle {
@Override
public StyleType getStyleType() {
return StyleType.UPPER_UNDERLINE;
}
@Override
public String tableName(Class> entityType) {
return GeneralUtils.underline(entityType.getSimpleName()).toUpperCase();
}
@Override
public String tableAlias(Class> entityType) {
String tableName = entityType.getSimpleName();
return GeneralUtils.abbreviate(tableName,0,true).toUpperCase();
}
@Override
public String columnName(Field field) {
return GeneralUtils.underline(field.getName()).toUpperCase();
}
@Override
public String columnName(MybatisField field) {
return columnName(field.field());
}
@Override
public String columnName(MybatisTable table, MybatisField field) {
return columnName(field);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy