use of org.mybatis.generator.api.dom.kotlin.FullyQualifiedKotlinType in project generator by mybatis.
the class KotlinMapperAndExtensionsGenerator method createMapperInterfaceFile.
protected KotlinFile createMapperInterfaceFile() {
FullyQualifiedKotlinType type = new FullyQualifiedKotlinType(introspectedTable.getMyBatis3JavaMapperType());
KotlinFile kf = new KotlinFile(type.getShortNameWithoutTypeArguments());
kf.setPackage(type.getPackageName());
return kf;
}
use of org.mybatis.generator.api.dom.kotlin.FullyQualifiedKotlinType in project generator by mybatis.
the class KotlinMapperAndExtensionsGenerator method createMapperInterface.
protected KotlinType createMapperInterface(KotlinFile kotlinFile) {
FullyQualifiedKotlinType type = new FullyQualifiedKotlinType(introspectedTable.getMyBatis3JavaMapperType());
KotlinType intf = KotlinType.newInterface(type.getShortNameWithoutTypeArguments()).withAnnotation(// $NON-NLS-1$
"@Mapper").build();
// $NON-NLS-1$
kotlinFile.addImport("org.apache.ibatis.annotations.Mapper");
kotlinFile.addNamedItem(intf);
context.getCommentGenerator().addFileComment(kotlinFile);
return intf;
}
use of org.mybatis.generator.api.dom.kotlin.FullyQualifiedKotlinType in project generator by mybatis.
the class KotlinMapperAndExtensionsGenerator method preCalculate.
protected void preCalculate() {
supportClassGenerator = new KotlinDynamicSqlSupportClassGenerator(context, introspectedTable, warnings);
recordType = new FullyQualifiedKotlinType(introspectedTable.getKotlinRecordType());
// $NON-NLS-1$
resultMapId = recordType.getShortNameWithoutTypeArguments() + "Result";
fragmentGenerator = new KotlinFragmentGenerator.Builder().withIntrospectedTable(introspectedTable).withResultMapId(resultMapId).withDynamicSqlSupportClassGenerator(supportClassGenerator).withTableFieldName(supportClassGenerator.getTablePropertyName()).build();
hasGeneratedKeys = introspectedTable.getGeneratedKey().isPresent();
}
Aggregations