public class BindTableGenerator extends AbstractBuilder implements ModelElementVisitor<SQLEntity,SQLProperty>
Generate class ${entity}Table which represents table for entity.
| Modifier and Type | Field and Description |
|---|---|
static String |
SUFFIX |
classBuilder, elementUtils, filer, model| Constructor and Description |
|---|
BindTableGenerator(Elements elementUtils,
Filer filer,
SQLiteDatabaseSchema model) |
| Modifier and Type | Method and Description |
|---|---|
static com.abubusoft.kripton.common.Pair<String,String> |
buldIndexes(GeneratedTypeElement entity,
boolean unique,
int counter)
A generated element can have only a primary key and two FK
|
static com.abubusoft.kripton.common.Pair<String,String> |
buldIndexes(SQLEntity entity,
boolean unique,
int counter) |
static void |
generate(Elements elementUtils,
Filer filer,
SQLiteDatabaseSchema schema,
Set<GeneratedTypeElement> generatedEntities)
Generate table for entities
|
static String |
getTableClassName(String entityName) |
static com.squareup.javapoet.ClassName |
tableClassName(SQLDaoDefinition dao,
SQLEntity entity) |
void |
visit(SQLiteDatabaseSchema schema,
SQLEntity entity) |
void |
visit(SQLProperty kriptonProperty) |
public static final String SUFFIX
public BindTableGenerator(Elements elementUtils, Filer filer, SQLiteDatabaseSchema model)
public static void generate(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema, Set<GeneratedTypeElement> generatedEntities) throws Exception
elementUtils - filer - schema - generatedEntities - Exceptionpublic static com.squareup.javapoet.ClassName tableClassName(SQLDaoDefinition dao, SQLEntity entity)
public void visit(SQLiteDatabaseSchema schema, SQLEntity entity) throws Exception
visit in interface ModelElementVisitor<SQLEntity,SQLProperty>Exceptionpublic static com.abubusoft.kripton.common.Pair<String,String> buldIndexes(SQLEntity entity, boolean unique, int counter)
public static com.abubusoft.kripton.common.Pair<String,String> buldIndexes(GeneratedTypeElement entity, boolean unique, int counter)
entity - unique - counter - public void visit(SQLProperty kriptonProperty)
visit in interface ModelElementVisitor<SQLEntity,SQLProperty>Copyright © 2017. All rights reserved.