public static void main(String[] args) throws Exception{ Schema schema = new Schema(1, "com.codingbingo.fastreader.dao"); Entity book = schema.addEntity("Book"); book.addIdProperty().primaryKey().autoincrement(); book.addStringProperty("bookName").notNull(); book.addStringProperty("bookImagePath"); book.addStringProperty("description"); book.addStringProperty("tags"); book.addStringProperty("writer"); book.addStringProperty("charSet"); book.addStringProperty("bookPath"); book.addIntProperty("currentChapter"); book.addIntProperty("currentPosition"); book.addIntProperty("processStatus").notNull(); Entity chapter = schema.addEntity("Chapter"); chapter.addIdProperty().primaryKey().autoincrement(); chapter.addStringProperty("title"); chapter.addIntProperty("position").notNull(); chapter.addIntProperty("pageCount"); chapter.addBooleanProperty("isRead"); Property bookIdProperty = chapter.addLongProperty("bookId").notNull().getProperty(); chapter.addToOne(book, bookIdProperty); new DaoGenerator().generateAll(schema, "/Users/bingo/Git/FastReader/app/src/main/java"); }
private static void addTest3(Schema schema) { Entity testData = schema.addEntity("TestData3"); testData.addIdProperty().primaryKey().autoincrement(); testData.addStringProperty("testString"); testData.addLongProperty("testLong"); testData.addDateProperty("testDate"); testData.addIntProperty("testInt"); testData.addBooleanProperty("testBoolean"); } }
private static void addTest(Schema schema) { Entity testData = schema.addEntity("TestData"); testData.addIdProperty().primaryKey().autoincrement(); testData.addStringProperty("testString"); testData.addLongProperty("testLong"); testData.addDateProperty("testDate"); testData.addIntProperty("testInt"); testData.addBooleanProperty("testBoolean"); } private static void addTest2(Schema schema) {
private static void addTest2(Schema schema) { Entity testData = schema.addEntity("TestData2"); testData.addIdProperty().primaryKey().autoincrement(); testData.addStringProperty("testString"); testData.addLongProperty("testLong"); testData.addDateProperty("testDate"); testData.addIntProperty("testInt"); testData.addBooleanProperty("testBoolean"); } private static void addTest3(Schema schema) {
protected void createAutoincrement() { Entity entity = schema.addEntity("AutoincrementEntity"); entity.addIdProperty().autoincrement(); }