本文整理匯總了Java中de.greenrobot.daogenerator.Entity.addByteArrayProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java Entity.addByteArrayProperty方法的具體用法?Java Entity.addByteArrayProperty怎麽用?Java Entity.addByteArrayProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類de.greenrobot.daogenerator.Entity
的用法示例。
在下文中一共展示了Entity.addByteArrayProperty方法的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();
}
}
示例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();
}
}
示例3: addPebbleHealthActivitySample
import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static Entity addPebbleHealthActivitySample(Schema schema, Entity user, Entity device) {
Entity activitySample = addEntity(schema, "PebbleHealthActivitySample");
addCommonActivitySampleProperties("AbstractPebbleHealthActivitySample", activitySample, user, device);
activitySample.addByteArrayProperty("rawPebbleHealthData");
activitySample.addIntProperty("rawIntensity").notNull();
activitySample.addIntProperty("steps").notNull();
return activitySample;
}
示例4: addPebbleHealthActivityKindOverlay
import de.greenrobot.daogenerator.Entity; //導入方法依賴的package包/類
private static Entity addPebbleHealthActivityKindOverlay(Schema schema, Entity user, Entity device) {
Entity activityOverlay = addEntity(schema, "PebbleHealthActivityOverlay");
activityOverlay.addIntProperty("timestampFrom").notNull().primaryKey();
activityOverlay.addIntProperty("timestampTo").notNull().primaryKey();
activityOverlay.addIntProperty("rawKind").notNull().primaryKey();
Property deviceId = activityOverlay.addLongProperty("deviceId").primaryKey().getProperty();
activityOverlay.addToOne(device, deviceId);
Property userId = activityOverlay.addLongProperty("userId").getProperty();
activityOverlay.addToOne(user, userId);
activityOverlay.addByteArrayProperty("rawPebbleHealthData");
return activityOverlay;
}
示例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();
}