当前位置: 首页>>代码示例>>Java>>正文


Java Schema.addEntity方法代码示例

本文整理汇总了Java中org.greenrobot.greendao.generator.Schema.addEntity方法的典型用法代码示例。如果您正苦于以下问题:Java Schema.addEntity方法的具体用法?Java Schema.addEntity怎么用?Java Schema.addEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.greenrobot.greendao.generator.Schema的用法示例。


在下文中一共展示了Schema.addEntity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addTraceRepo

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void addTraceRepo(Schema schema){
    Entity entity = schema.addEntity("TraceRepo");
    entity.addLongProperty("id").primaryKey().notNull();
    entity.addStringProperty("name").notNull();
    entity.addStringProperty("description");
    entity.addStringProperty("language");
    entity.addIntProperty("stargazersCount");
    entity.addIntProperty("watchersCount");
    entity.addIntProperty("forksCount");
    entity.addBooleanProperty("fork");

    entity.addStringProperty("ownerLogin");
    entity.addStringProperty("ownerAvatarUrl");

    entity.addDateProperty("startTime");
    entity.addDateProperty("latestTime");
    entity.addIntProperty("traceNum");
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:19,代码来源:AppDaoGenerator.java

示例2: addBookMarkRepo

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void addBookMarkRepo(Schema schema){
    Entity entity = schema.addEntity("BookMarkRepo");
    entity.addLongProperty("id").primaryKey().notNull();
    entity.addStringProperty("name").notNull();
    entity.addStringProperty("description");
    entity.addStringProperty("language");
    entity.addIntProperty("stargazersCount");
    entity.addIntProperty("watchersCount");
    entity.addIntProperty("forksCount");
    entity.addBooleanProperty("fork");

    entity.addStringProperty("ownerLogin");
    entity.addStringProperty("ownerAvatarUrl");

    entity.addDateProperty("markTime");
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:17,代码来源:AppDaoGenerator.java

示例3: generateSchemas

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void generateSchemas() throws Exception, IOException {

    Schema schema =
        new Schema(Config.BATTERY_WATCHER_DB_SCHEMA_VERSION, Config.BATTERY_WATCHER_PACKAGE);

    // ----- Measurements -----
    Entity measurements = schema.addEntity("Measurement");
    measurements.setTableName("measurement");
    measurements.addIdProperty().autoincrement().index();
    measurements.addFloatProperty("power");
    measurements.addLongProperty("memory");
    measurements.addFloatProperty("cpuLoad");
    measurements.addLongProperty("timestamp").notNull();

    // **************************
    // **** GENERATE DAOs ****
    // **************************
    new DaoGenerator().generateAll(schema, Config.BATTERY_WATCHER_OUTPUT);
  }
 
开发者ID:Telecooperation,项目名称:assistance-platform-client-sdk-android,代码行数:20,代码来源:BatteryWatcherDatabaseGenerator.java

示例4: main

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
public static void main(String[] args) {
    Schema schema = new Schema(DB_VERSION, PACKAGE);

    Entity user = schema.addEntity(USER_ENTITY);
    Property userPk = addCommonColumns(user);

    Entity message = schema.addEntity(MESSAGE_ENTITY);
    message.addIdProperty().autoincrement();
    message.addStringProperty(CONTENT);
    message.addLongProperty(CLIENT_ID).notNull();
    message.addIntProperty(CREATED_AT).notNull();
    message.addDoubleProperty(SORTED_BY).notNull();
    message.addLongProperty(COMMAND_ID).notNull().index();
    message.addLongProperty(SENDER_ID).notNull();
    message.addLongProperty(CHANNEL_ID).notNull();

    // One-to-many relationship
    message.addToMany(user, userPk, READERS);

    try {
        System.out.println("current path: " + new File(".").getAbsolutePath());
        new DaoGenerator().generateAll(schema, "./ORM-Benchmark/src/main/java/");
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:touchlab,项目名称:android-orm-benchmark-updated,代码行数:27,代码来源:Generator.java

示例5: addPgeG11Bill

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void addPgeG11Bill(Schema schema, final Entity pgePrices) {
    Entity pgeBill = schema.addEntity("PgeG11Bill");
    pgeBill.implementsInterface("Bill");

    pgeBill.addIdProperty().autoincrement();
    pgeBill.addIntProperty("readingFrom");
    pgeBill.addIntProperty("readingTo");

    pgeBill.addDateProperty("dateFrom");
    pgeBill.addDateProperty("dateTo");

    pgeBill.addDoubleProperty("amountToPay");

    Property pricesId = pgeBill.addLongProperty("pricesId").getProperty();
    pgeBill.addToOne(pgePrices, pricesId);
}
 
开发者ID:sewerk,项目名称:Bill-Calculator,代码行数:17,代码来源:GreenDaoGenerator.java

示例6: addPgeG12Bill

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void addPgeG12Bill(final Schema schema, final Entity pgePrices) {
    Entity pgeBill = schema.addEntity("PgeG12Bill");
    pgeBill.implementsInterface("Bill");

    pgeBill.addIdProperty().autoincrement();
    pgeBill.addIntProperty("readingDayFrom");
    pgeBill.addIntProperty("readingDayTo");
    pgeBill.addIntProperty("readingNightFrom");
    pgeBill.addIntProperty("readingNightTo");

    pgeBill.addDateProperty("dateFrom");
    pgeBill.addDateProperty("dateTo");

    pgeBill.addDoubleProperty("amountToPay");

    Property pricesId = pgeBill.addLongProperty("pricesId").getProperty();
    pgeBill.addToOne(pgePrices, pricesId);
}
 
开发者ID:sewerk,项目名称:Bill-Calculator,代码行数:19,代码来源:GreenDaoGenerator.java

示例7: addPgePrices

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static Entity addPgePrices(final Schema schema) {
    Entity pgePrices = schema.addEntity("PgePrices");
    pgePrices.implementsInterface("pl.srw.billcalculator.pojo.IPgePrices");
    pgePrices.implementsSerializable();

    pgePrices.addIdProperty().autoincrement();
    pgePrices.addStringProperty("zaEnergieCzynna");
    pgePrices.addStringProperty("skladnikJakosciowy");
    pgePrices.addStringProperty("oplataSieciowa");
    pgePrices.addStringProperty("oplataPrzejsciowa");
    pgePrices.addStringProperty("oplataStalaZaPrzesyl");
    pgePrices.addStringProperty("oplataAbonamentowa");

    pgePrices.addStringProperty("zaEnergieCzynnaDzien");
    pgePrices.addStringProperty("zaEnergieCzynnaNoc");
    pgePrices.addStringProperty("oplataSieciowaDzien");
    pgePrices.addStringProperty("oplataSieciowaNoc");

    pgePrices.addStringProperty("oplataOze");
    return pgePrices;
}
 
开发者ID:sewerk,项目名称:Bill-Calculator,代码行数:22,代码来源:GreenDaoGenerator.java

示例8: addPgnigBill

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void addPgnigBill(final Schema schema, final Entity pgnigPrices) {
    Entity pgnigBill = schema.addEntity("PgnigBill");
    pgnigBill.implementsInterface("Bill");

    pgnigBill.addIdProperty();
    pgnigBill.addIntProperty("readingFrom");
    pgnigBill.addIntProperty("readingTo");

    pgnigBill.addDateProperty("dateFrom");
    pgnigBill.addDateProperty("dateTo");

    pgnigBill.addDoubleProperty("amountToPay");

    Property pricesId = pgnigBill.addLongProperty("pricesId").getProperty();
    pgnigBill.addToOne(pgnigPrices, pricesId);
}
 
开发者ID:sewerk,项目名称:Bill-Calculator,代码行数:17,代码来源:GreenDaoGenerator.java

示例9: addTauronG11Bill

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void addTauronG11Bill(final Schema schema, final Entity tauronPrices) {
    Entity bill = schema.addEntity("TauronG11Bill");
    bill.implementsInterface("Bill");

    bill.addIdProperty().autoincrement();
    bill.addIntProperty("readingFrom");
    bill.addIntProperty("readingTo");

    bill.addDateProperty("dateFrom");
    bill.addDateProperty("dateTo");

    bill.addDoubleProperty("amountToPay");

    Property pricesId = bill.addLongProperty("pricesId").getProperty();
    bill.addToOne(tauronPrices, pricesId);
}
 
开发者ID:sewerk,项目名称:Bill-Calculator,代码行数:17,代码来源:GreenDaoGenerator.java

示例10: addTauronG12Bill

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void addTauronG12Bill(final Schema schema, final Entity tauronPrices) {
    Entity bill = schema.addEntity("TauronG12Bill");
    bill.implementsInterface("Bill");

    bill.addIdProperty().autoincrement();
    bill.addIntProperty("readingDayFrom");
    bill.addIntProperty("readingDayTo");
    bill.addIntProperty("readingNightFrom");
    bill.addIntProperty("readingNightTo");

    bill.addDateProperty("dateFrom");
    bill.addDateProperty("dateTo");

    bill.addDoubleProperty("amountToPay");

    Property pricesId = bill.addLongProperty("pricesId").getProperty();
    bill.addToOne(tauronPrices, pricesId);
}
 
开发者ID:sewerk,项目名称:Bill-Calculator,代码行数:19,代码来源:GreenDaoGenerator.java

示例11: addTauronPrices

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static Entity addTauronPrices(final Schema schema) {
    Entity prices = schema.addEntity("TauronPrices");
    prices.implementsInterface("pl.srw.billcalculator.pojo.ITauronPrices");
    prices.implementsSerializable();

    prices.addIdProperty().autoincrement();
    prices.addStringProperty("energiaElektrycznaCzynna");
    prices.addStringProperty("oplataDystrybucyjnaZmienna");
    prices.addStringProperty("oplataDystrybucyjnaStala");
    prices.addStringProperty("oplataPrzejsciowa");
    prices.addStringProperty("oplataAbonamentowa");

    prices.addStringProperty("energiaElektrycznaCzynnaDzien");
    prices.addStringProperty("energiaElektrycznaCzynnaNoc");
    prices.addStringProperty("oplataDystrybucyjnaZmiennaDzien");
    prices.addStringProperty("oplataDystrybucyjnaZmiennaNoc");

    prices.addStringProperty("oplataOze");
    return prices;
}
 
开发者ID:sewerk,项目名称:Bill-Calculator,代码行数:21,代码来源:GreenDaoGenerator.java

示例12: createSchema2

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private Schema createSchema2() {
    Schema schema2 = new Schema(1, "org.greenrobot.greendao.daotest2");
    schema2.setDefaultJavaPackageTest("org.greenrobot.greendao.daotest2.entity");
    schema2.setDefaultJavaPackageDao("org.greenrobot.greendao.daotest2.dao");
    schema2.enableKeepSectionsByDefault();

    Entity keepEntity = schema2.addEntity("KeepEntity");
    keepEntity.addIdProperty();

    Entity toManyTarget2 = schema2.addEntity("ToManyTarget2");
    toManyTarget2.addIdProperty();
    Property toManyTarget2FkId = toManyTarget2.addLongProperty("fkId").getProperty();
    toManyTarget2.setSkipGenerationTest(true);

    Entity toOneTarget2 = schema2.addEntity("ToOneTarget2");
    toOneTarget2.addIdProperty();
    toOneTarget2.setJavaPackage("org.greenrobot.greendao.daotest2.to1_specialentity");
    toOneTarget2.setJavaPackageDao("org.greenrobot.greendao.daotest2.to1_specialdao");
    toOneTarget2.setJavaPackageTest("org.greenrobot.greendao.daotest2.to1_specialtest");
    toOneTarget2.setSkipGenerationTest(true);

    Entity relationSource2 = schema2.addEntity("RelationSource2");
    relationSource2.addIdProperty();
    relationSource2.addToMany(toManyTarget2, toManyTarget2FkId);
    Property toOneId = relationSource2.addLongProperty("toOneId").getProperty();
    relationSource2.addToOne(toOneTarget2, toOneId);
    relationSource2.setJavaPackage("org.greenrobot.greendao.daotest2.specialentity");
    relationSource2.setJavaPackageDao("org.greenrobot.greendao.daotest2.specialdao");
    relationSource2.setJavaPackageTest("org.greenrobot.greendao.daotest2.specialtest");
    relationSource2.setSkipGenerationTest(true);
    return schema2;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:33,代码来源:TestDaoGenerator.java

示例13: createSchemaUnitTest

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private Schema createSchemaUnitTest() {
    Schema schema = new Schema(1, "org.greenrobot.greendao.unittest");

    Entity entity = schema.addEntity("MinimalEntity");
    entity.addIdProperty();
    return schema;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:TestDaoGenerator.java

示例14: addAuthUser

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
/**
 * add auth user
 * @param schema
 */
private static void addAuthUser(Schema schema){
    Entity entity = schema.addEntity("AuthUser");
    entity.addStringProperty("accessToken").primaryKey().notNull();
    entity.addDateProperty("authTime").notNull();
    entity.addIntProperty("expireIn").notNull();
    entity.addStringProperty("scope").notNull();
    entity.addBooleanProperty("selected").notNull();

    entity.addStringProperty("loginId").notNull();
    entity.addStringProperty("name");
    entity.addStringProperty("avatar");
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:17,代码来源:AppDaoGenerator.java

示例15: addTraceUser

import org.greenrobot.greendao.generator.Schema; //导入方法依赖的package包/类
private static void addTraceUser(Schema schema){
    Entity entity = schema.addEntity("TraceUser");
    entity.addStringProperty("login").primaryKey().notNull();
    entity.addStringProperty("name");
    entity.addStringProperty("avatarUrl");
    entity.addIntProperty("followers");
    entity.addIntProperty("following");

    entity.addDateProperty("startTime");
    entity.addDateProperty("latestTime");
    entity.addIntProperty("traceNum");
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:13,代码来源:AppDaoGenerator.java


注:本文中的org.greenrobot.greendao.generator.Schema.addEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。