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


Java Entity.addFloatProperty方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: addElectricRecord

import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addElectricRecord(Schema schema) {
    Entity Record = schema.addEntity("ElectricRecord");
    Record.addIdProperty().primaryKey().autoincrement();
    Record.addStringProperty("area");
    Record.addIntProperty("building");
    Record.addIntProperty("dorm");
    Record.addFloatProperty("remain");
    Record.addDateProperty("date");
}
 
开发者ID:BingyanStudio,项目名称:CamPass-Android,代码行数:10,代码来源:MyDaoGenerator.java

示例5: 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.addFloatProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。