當前位置: 首頁>>代碼示例>>Java>>正文


Java Entity.addDoubleProperty方法代碼示例

本文整理匯總了Java中de.greenrobot.daogenerator.Entity.addDoubleProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Entity.addDoubleProperty方法的具體用法?Java Entity.addDoubleProperty怎麽用?Java Entity.addDoubleProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在de.greenrobot.daogenerator.Entity的用法示例。


在下文中一共展示了Entity.addDoubleProperty方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addUser

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addUser(Schema schema) {
    Entity user = schema.addEntity("UserEntity");
    user.setSuperclass("UserEntityBase");
    user.addIdProperty().primaryKey();
    user.addStringProperty("name");
    user.addIntProperty("gender").notNull();
    user.addDateProperty("birthday").notNull();
    user.addIntProperty("age");
    //user.addIntProperty("measurementSystem").notNull();
    user.addDoubleProperty("weight").notNull();
    user.addIntProperty("height").notNull();
    user.addIntProperty("activityFactor").notNull();
    user.addDoubleProperty("bmr");
    user.addIntProperty("goal").notNull();
    user.addDoubleProperty("maintain");
    user.addDoubleProperty("burn");
    user.addDoubleProperty("gain");
}
 
開發者ID:andreshj87,項目名稱:CleanFit,代碼行數:19,代碼來源:GreenDAOGenerator.java

示例2: main

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
    Schema schema = new Schema(3, "br.com.ricardolonga.mercadinho");

    Entity categoria = schema.addEntity("Categoria");
    categoria.addIdProperty().autoincrement();
    categoria.addStringProperty("nome").notNull();
    categoria.implementsSerializable();

    Entity item = schema.addEntity("Item");
    item.addIdProperty().autoincrement();
    item.addStringProperty("nome").notNull();
    item.addIntProperty("quantidade");
    item.addDoubleProperty("valorUnitario");
    item.addDoubleProperty("valorTotal");
    item.implementsSerializable();
    Property idCategoria = item.addLongProperty("idCategoria").notNull().getProperty();

    item.addToOne(categoria, idCategoria);
    categoria.addToMany(item, idCategoria, "itens");

    new DaoGenerator().generateAll(schema, "../mercadinho/src-gen");
}
 
開發者ID:ricardolonga,項目名稱:mercadinho-generator,代碼行數:23,代碼來源:MercadinhoGenerator.java

示例3: main

import de.greenrobot.daogenerator.Entity; //導入方法依賴的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);
    message.addIntProperty(CREATED_AT);
    message.addDoubleProperty(SORTED_BY);
    message.addLongProperty(COMMAND_ID).index();
    message.addLongProperty(SENDER_ID).notNull();
    message.addLongProperty(CHANNEL_ID).notNull();

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

    try {
        new DaoGenerator().generateAll(schema, "../ORM-Benchmark/src/");
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:littleinc,項目名稱:android-orm-benchmark,代碼行數:26,代碼來源:Generator.java

示例4: genField

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void genField(Entity entity, Map<String, String> attributes) {
    String name = attributes.get("name");
    String type = attributes.get("type");
    String def = attributes.get("default");
    String comment = attributes.get("comment");
    String index = attributes.get("index");
    String primaryKey = attributes.get("primaryKey");
    String notNull = attributes.get("notNull");
    String autoincrement = attributes.get("autoInc");

    Property.PropertyBuilder builder = null;
    if (type.equals("String")) {
        builder = entity.addStringProperty(name);
    } else if (type.equals("int")) {
        builder = entity.addIntProperty(name);
    } else if (type.equals("long")) {
        builder = entity.addLongProperty(name);
    } else if (type.equals("boolean")) {
        builder = entity.addBooleanProperty(name);
    } else if (type.equals("byte[]")) {
        builder = entity.addByteArrayProperty(name);
    } else if (type.equals("byte")) {
        builder = entity.addByteProperty(name);
    } else if (type.equals("float")) {
        builder = entity.addFloatProperty(name);
    } else if (type.equals("double")) {
        builder = entity.addDoubleProperty(name);
    }
    if ("true".equals(notNull)) {
        builder.notNull();
    }
    if ("true".equals(primaryKey)) {
        builder.primaryKey();
    }
    if ("true".equals(autoincrement)) {
        builder.autoincrement();
    }
}
 
開發者ID:AlbieLiang,項目名稱:ArbitraryGen,代碼行數:39,代碼來源:DatabaseGenerator.java

示例5: genField

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void genField(Entity entity, JSONObject jsonObj) {
    String name = jsonObj.optString("@name");
    String type = jsonObj.optString("@type");
    String def = jsonObj.optString("@default");
    String comment = jsonObj.optString("@comment");
    String index = jsonObj.optString("@index");
    String primaryKey = jsonObj.optString("@primaryKey");
    String notNull = jsonObj.optString("@notNull");
    String autoincrement = jsonObj.optString("@autoInc");

    Property.PropertyBuilder builder = null;
    if (type.equals("String")) {
        builder = entity.addStringProperty(name);
    } else if (type.equals("int")) {
        builder = entity.addIntProperty(name);
    } else if (type.equals("long")) {
        builder = entity.addLongProperty(name);
    } else if (type.equals("boolean")) {
        builder = entity.addBooleanProperty(name);
    } else if (type.equals("byte[]")) {
        builder = entity.addByteArrayProperty(name);
    } else if (type.equals("byte")) {
        builder = entity.addByteProperty(name);
    } else if (type.equals("float")) {
        builder = entity.addFloatProperty(name);
    } else if (type.equals("double")) {
        builder = entity.addDoubleProperty(name);
    }
    if ("true".equals(notNull)) {
        builder.notNull();
    }
    if ("true".equals(primaryKey)) {
        builder.primaryKey();
    }
    if ("true".equals(autoincrement)) {
        builder.autoincrement();
    }
}
 
開發者ID:AlbieLiang,項目名稱:ArbitraryGen,代碼行數:39,代碼來源:GreenDaoGenerator.java

示例6: addCategoriesTable

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addCategoriesTable(Schema mSchema) {
    Entity category = mSchema.addEntity("Category");
    category.addIdProperty().primaryKey().autoincrement();
    category.addStringProperty("NameEn");
    category.addStringProperty("NameEl");


    Entity startPoints = mSchema.addEntity("StartPoint");
    startPoints.addIdProperty().primaryKey().autoincrement();
    startPoints.addStringProperty("NameEn");
    startPoints.addStringProperty("NameEl");
    startPoints.addDoubleProperty("lat");
    startPoints.addDoubleProperty("longitude");


    Entity creators = mSchema.addEntity("Creator");
    creators.addIdProperty().primaryKey().autoincrement();
    creators.addStringProperty("NameEn");
    creators.addStringProperty("NameEl");
    creators.addStringProperty("Organization");
    creators.addStringProperty("JobEn");
    creators.addStringProperty("JobEl");
    creators.addStringProperty("AddressEn");
    creators.addStringProperty("AddressEl");
    creators.addStringProperty("websiteAddress");
    creators.addDoubleProperty("lat");
    creators.addDoubleProperty("longitude");
    creators.addLongProperty("categoryId");
    creators.addLongProperty("startingPointId");
    creators.addStringProperty("map_image");
    creators.addStringProperty("details_image");

    Entity bikes = mSchema.addEntity("BikesParkingPois");
    bikes.addIdProperty().primaryKey().autoincrement();
    bikes.addDoubleProperty("latitude");
    bikes.addDoubleProperty("longitude");
    bikes.addStringProperty("name");

}
 
開發者ID:premsot,項目名稱:CreativeTourismThessaloniki,代碼行數:40,代碼來源:DbGenerator.java

示例7: addGeoLocation

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static void addGeoLocation(final Schema schema) {
    final Entity geoLocation = schema.addEntity("GeoLocation");
    geoLocation.implementsInterface("nu.wasis.geotracker.model.DomainObject");
    geoLocation.addIdProperty();
    geoLocation.addDoubleProperty("latitude").notNull();
    geoLocation.addDoubleProperty("longitude").notNull();
    geoLocation.addDoubleProperty("altitude");
    geoLocation.addFloatProperty("accuracy");
    geoLocation.addFloatProperty("speed");
    geoLocation.addLongProperty("time");
}
 
開發者ID:sne11ius,項目名稱:GeoTracker,代碼行數:12,代碼來源:GeoTrackerDaoGenerator.java

示例8: createSimple

import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
protected void createSimple() {
    Entity simple = schema.addEntity("SimpleEntity");
    simple.addIdProperty();
    simple.addBooleanProperty("simpleBoolean");
    simple.addByteProperty("simpleByte");
    simple.addShortProperty("simpleShort");
    simple.addIntProperty("simpleInt");
    simple.addLongProperty("simpleLong");
    simple.addFloatProperty("simpleFloat");
    simple.addDoubleProperty("simpleDouble");
    simple.addStringProperty("simpleString");
    simple.addByteArrayProperty("simpleByteArray");
    
    simple.addContentProvider().readOnly();
}
 
開發者ID:itsmechlark,項目名稱:greendao-cipher,代碼行數:16,代碼來源:TestDaoGenerator.java


注:本文中的de.greenrobot.daogenerator.Entity.addDoubleProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。