private static void addDownloadLabel(Schema schema) { Entity entity = schema.addEntity("DownloadLabel"); entity.setTableName("DOWNLOAD_LABELS"); entity.setClassNameDao("DownloadLabelDao"); entity.addIdProperty(); entity.addStringProperty("label"); entity.addLongProperty("time").notNull(); }
private static void addLocalFavorites(Schema schema) { Entity entity = schema.addEntity("LocalFavoriteInfo"); entity.setTableName("LOCAL_FAVORITES"); entity.setClassNameDao("LocalFavoritesDao"); entity.setSuperclass("GalleryInfo"); // GalleryInfo data entity.addLongProperty("gid").primaryKey().notNull(); entity.addStringProperty("token"); entity.addStringProperty("title"); entity.addStringProperty("titleJpn"); entity.addStringProperty("thumb"); entity.addIntProperty("category").notNull(); entity.addStringProperty("posted"); entity.addStringProperty("uploader"); entity.addFloatProperty("rating").notNull(); entity.addStringProperty("simpleLanguage"); // LocalFavoriteInfo data entity.addLongProperty("time").notNull(); }
private static void addFilter(Schema schema) { Entity entity = schema.addEntity("Filter"); entity.setTableName("FILTER"); entity.setClassNameDao("FilterDao"); entity.addIdProperty(); entity.addIntProperty("mode").notNull(); entity.addStringProperty("text"); entity.addBooleanProperty("enable"); }
private static void addStory(Schema schema) { Entity savedStory = schema.addEntity("SavedStory"); savedStory.addIdProperty(); savedStory.addStringProperty("image"); savedStory.addStringProperty("title"); savedStory.addStringProperty("date"); savedStory.addIntProperty("position"); }
private static void addStoryDetail(Schema schema) { Entity savedDailyDetail = schema.addEntity("SavedDailyDetail"); savedDailyDetail.addIdProperty(); savedDailyDetail.addStringProperty("body"); savedDailyDetail.addStringProperty("image_source"); savedDailyDetail.addStringProperty("image"); savedDailyDetail.addStringProperty("title"); savedDailyDetail.addStringProperty("share_url"); savedDailyDetail.addStringProperty("js"); savedDailyDetail.addStringProperty("css"); } }
@SuppressWarnings("unused") private static void addCustomerOrder(Schema schema) { Entity customer = schema.addEntity("Customer"); customer.addIdProperty(); customer.addStringProperty("name").notNull(); Entity order = schema.addEntity("Order"); order.setTableName("ORDERS"); // "ORDER" is a reserved keyword order.addIdProperty(); Property orderDate = order.addDateProperty("date").getProperty(); Property customerId = order.addLongProperty("customerId").notNull().getProperty(); order.addToOne(customer, customerId); ToMany customerToOrders = customer.addToMany(order, customerId); customerToOrders.setName("orders"); customerToOrders.orderAsc(orderDate); }
private static void addStatusTable(Schema schema) { Entity table = schema.addEntity("Green_TimeLineStatus"); table.setHasKeepSections(true); table.setTableName(TimeLineStatusTable.TABLE_NAME); table.implementsSerializable(); table.addIntProperty(TimeLineStatusTable.ID); table.addStringProperty(TimeLineStatusTable.ACCOUNTID); table.addStringProperty(TimeLineStatusTable.MBLOGID); table.addStringProperty(TimeLineStatusTable.JSONDATA); }
public static void addMusicInfo(Schema schema) { Entity entity = schema.addEntity("MusicInfo"); entity.addLongProperty("songId").primaryKey(); entity.addLongProperty("albumId"); entity.addLongProperty("artistId"); entity.addStringProperty("title"); entity.addStringProperty("artist"); entity.addIntProperty("duration"); entity.addStringProperty("path"); entity.addBooleanProperty("favorite"); }
public static void addAlbumInfo(Schema schema){ Entity entity=schema.addEntity("AlbumInfo"); entity.addLongProperty("albumId").primaryKey(); entity.addStringProperty("title"); //专辑名 entity.addStringProperty("artist"); entity.addIntProperty("numSongs"); entity.addStringProperty("albumArt"); //封面地址 }
private static void addAqi(Schema schema) { Entity weekForeCast = schema.addEntity("Aqi"); weekForeCast.addStringProperty("areaid"); weekForeCast.addIntProperty("aqi"); weekForeCast.addStringProperty("quality"); weekForeCast.addIntProperty("pm2_5"); weekForeCast.addIntProperty("pm10"); weekForeCast.addIntProperty("so2"); weekForeCast.addIntProperty("no2"); }
private static void addTable(Schema schema) { Entity note = schema.addEntity("NewsChannelTable"); // note.addIdProperty(); /** * 频道名称 */ note.addStringProperty("newsChannelName").notNull().primaryKey().index(); /** * 频道id */ note.addStringProperty("newsChannelId").notNull(); /** * 频道类型 */ note.addStringProperty("newsChannelType").notNull(); /** * 选中的频道 */ note.addBooleanProperty("newsChannelSelect").notNull(); /** * 频道的排序位置 */ note.addIntProperty("newsChannelIndex").notNull(); /** * 频道是否是固定的 */ note.addBooleanProperty("newsChannelFixed"); }
private static void addNote(Schema schema) { Entity note = schema.addEntity("Note"); note.addIdProperty(); note.addStringProperty("text").notNull(); note.addStringProperty("comment"); note.addDateProperty("date"); }
/** * 采购表 * @param schema */ private static void addPurchase(Schema schema) { Entity note = schema.addEntity("Purchase"); note.addIdProperty().autoincrement().primaryKey(); note.addIntProperty("pid"); note.addStringProperty("porductName"); note.addIntProperty("basePrice"); note.addStringProperty("image"); note.addStringProperty("desc"); note.addIntProperty("number"); note.addIntProperty("price"); note.addStringProperty("status"); note.addBooleanProperty("planflag"); note.addStringProperty("cretetime"); }
private static void addUser(Schema schema) { Entity user = schema.addEntity("IpInfo"); user.addIdProperty().primaryKey(); user.addStringProperty("country"); user.addDoubleProperty("country_id"); user.addDoubleProperty("area"); user.addDoubleProperty("area_id"); user.addDoubleProperty("ip"); }
private static void addForeCast(Schema schema) { Entity weekForeCast = schema.addEntity("WeekForeCast"); weekForeCast.addStringProperty("areaid"); weekForeCast.addDateProperty("weatherDate"); weekForeCast.addStringProperty("weatherConditionStart"); weekForeCast.addStringProperty("weatherConditionEnd"); weekForeCast.addIntProperty("tempH"); weekForeCast.addIntProperty("tempL"); weekForeCast.addStringProperty("fx"); weekForeCast.addStringProperty("fj"); weekForeCast.addIntProperty("rainPerCent"); }
static Entity getAddressItemEntity(Schema schema, String name) { Entity simpleAddressItem = schema.addEntity(name); simpleAddressItem.addIdProperty(); simpleAddressItem.addStringProperty("name"); simpleAddressItem.addStringProperty("address"); simpleAddressItem.addStringProperty("city"); simpleAddressItem.addStringProperty("state"); simpleAddressItem.addLongProperty("phone"); return simpleAddressItem; }
private static void addZhishu(Schema schema) { Entity weekForeCast = schema.addEntity("Zhishu"); weekForeCast.addStringProperty("areaid"); weekForeCast.addStringProperty("name"); weekForeCast.addStringProperty("level"); weekForeCast.addStringProperty("text"); weekForeCast.addStringProperty("detail"); }
@Test public void testMinimalSchema() throws Exception { Schema schema = new Schema(1, "de.greenrobot.testdao"); Entity adressTable = schema.addEntity("Adresse"); Property idProperty = adressTable.addIdProperty().getProperty(); adressTable.addIntProperty("count").index(); adressTable.addIntProperty("dummy").notNull(); assertEquals(1, schema.getEntities().size()); assertEquals(3, adressTable.getProperties().size()); File daoFile = new File("test-out/de/greenrobot/testdao/" + adressTable.getClassName() + "Dao.java"); daoFile.delete(); assertFalse(daoFile.exists()); new DaoGenerator().generateAll(schema, "test-out"); assertEquals("PRIMARY KEY", idProperty.getConstraints()); assertTrue(daoFile.toString(), daoFile.exists()); }
user.addLongProperty("userID").primaryKey(); user.addStringProperty("nickName").notNull(); user.addStringProperty("uid").notNull();//用户在服务端的id user.addStringProperty("avatarUrl").notNull(); user.addStringProperty("mobile").notNull(); user.addStringProperty("gender").notNull(); userSport.addLongProperty("sportID").primaryKey(); userSport.addStringProperty("date").notNull();//日期 2016-12-12 13:24:23 userSport.addStringProperty("sportTime").notNull();//用时 userSport.addStringProperty("distance").notNull();//路程 userSport.addStringProperty("average").notNull();//平均速度 userSport.addStringProperty("pace").notNull();//配速 userSport.addStringProperty("calories").notNull();//卡路里 Property userProperty = user.addLongProperty("sportID").getProperty(); user.addToOne(userSport, userProperty); Property sportProperty = userSport.addLongProperty("userID").getProperty(); userSport.addToOne(user, sportProperty);
private static void initUserBean(Schema schema) { Entity userBean = schema.addEntity("User");// ���� //userBean.setTableName("user"); // ���ԶԱ������� userBean.addLongProperty("id").primaryKey().index();// �������� userBean.addStringProperty("name"); userBean.addStringProperty("password"); userBean.addStringProperty("nickname"); } }