本文整理汇总了Java中de.greenrobot.daogenerator.Entity.setSuperclass方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.setSuperclass方法的具体用法?Java Entity.setSuperclass怎么用?Java Entity.setSuperclass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.greenrobot.daogenerator.Entity
的用法示例。
在下文中一共展示了Entity.setSuperclass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addMusic
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addMusic(Schema schema) {
Entity music = schema.addEntity("Music");
music.addIdProperty();
music.addStringProperty("mediaType");//eg: mp3
music.addStringProperty("musicType");//eg:儿歌,英文
music.addStringProperty("url");
music.addStringProperty("singer");
music.addStringProperty("author");
music.addStringProperty("poster_url");//海报url
music.addStringProperty("lyrics_url");//歌词url
music.addStringProperty("name");
music.addLongProperty("size");
music.addStringProperty("albums");//专辑
music.addIntProperty("quality");
music.setSuperclass("cn.bmob.v3.BmobObject");
}
示例2: genTableEntity
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void genTableEntity(Schema schema, JSONObject jsonObj, String superClass) {
String table = jsonObj.optString("@name");
Entity entity = schema.addEntity(table);
entity.setSuperclass(superClass);
Object fieldObj = jsonObj.get("field");
if (fieldObj instanceof JSONArray) {
JSONArray arr = (JSONArray) fieldObj;
for (int i = 0, len = arr.size(); i < len; i++) {
JSONObject obj = arr.getJSONObject(i);
genField(entity, obj);
}
} else {
JSONObject json = (JSONObject) fieldObj;
genField(entity, json);
}
}
示例3: addMeal
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addMeal(Schema schema, Entity food) {
Entity meal = schema.addEntity("MealEntity");
meal.setSuperclass("MealEntityBase");
meal.addIdProperty().autoincrement().primaryKey();
meal.addDateProperty("date").notNull();
meal.addIntProperty("mealtime").notNull();
meal.addIntProperty("grams").notNull();
meal.addDoubleProperty("calories").notNull();
meal.addDoubleProperty("fats").notNull();
meal.addDoubleProperty("carbohydrates").notNull();
meal.addDoubleProperty("proteins").notNull();
meal.addStringProperty("foodName");
Property foodId = meal.addLongProperty("foodId").getProperty();
meal.addToOne(food, foodId);
}
示例4: 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");
}
示例5: addDownloads
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addDownloads(Schema schema) {
Entity entity = schema.addEntity("DownloadInfo");
entity.setTableName("DOWNLOADS");
entity.setClassNameDao("DownloadsDao");
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");
// DownloadInfo data
entity.addIntProperty("state").notNull();
entity.addIntProperty("legacy").notNull();
entity.addLongProperty("time").notNull();
entity.addStringProperty("label");
}
示例6: addHistoryInfo
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addHistoryInfo(Schema schema) {
Entity entity = schema.addEntity("HistoryInfo");
entity.setTableName("HISTORY");
entity.setClassNameDao("HistoryDao");
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");
// HistoryInfo data
entity.addIntProperty("mode").notNull();
entity.addLongProperty("time").notNull();
}
示例7: addLocalFavorites
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
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();
}
示例8: addBookmarks
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addBookmarks(Schema schema) {
Entity entity = schema.addEntity("BookmarkInfo");
entity.setTableName("BOOKMARKS");
entity.setClassNameDao("BookmarksBao");
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");
// Bookmark data
entity.addIntProperty("page").notNull();
entity.addLongProperty("time").notNull();
}
示例9: createVerification
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void createVerification(Schema schema, Entity book, Entity audioChapter) {
DaoHelperMethods.EntityInformation verificationInfo =
new DaoHelperMethods.EntityInformation(ModelNames.VERIFICATION, ModelNames.VERIFICATION_STRING_ATTRIBUTES);
verificationInfo.intAttributes = ModelNames.VERIFICATION_INT_ATTRIBUTES;
Entity verification = DaoHelperMethods.createEntity(schema, verificationInfo);
verification.setSuperclass(UW_DATABASE_MODEL_PROTOCOL);
DaoHelperMethods.createParentChildRelationship(
book, ModelNames.BOOK_VERIFICATIONS_ATTRIBUTE,
verification, ModelNames.VERIFICATION_BOOK_ATTRIBUTE);
DaoHelperMethods.createParentChildRelationship(
audioChapter, ModelNames.AUDIO_CHAPTER_VERIFICATIONS_ATTRIBUTE,
verification, ModelNames.VERIFICATION_AUDIO_CHAPTER_ATTRIBUTE);
}
示例10: addContactLink
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static Property addContactLink(Schema schema) {
Property contactLinkId;
Entity contactLink = schema.addEntity(EntityProperties.ContactLink);
contactLinkId = contactLink.addIdProperty().getProperty();
setManyToMany(contactLink, user, user);
contactLink.setSuperclass("Entity");
return contactLinkId;
}
示例11: addUser
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
/**
* @author:keivn
* @param schema
* one -- many user -- userAuth
*/
private static void addUser(Schema schema){
Entity user = schema.addEntity("User");
user.addIdProperty();
user.addStringProperty("user_id");
user.addStringProperty("nickname");
user.addStringProperty("avatar");
user.addIntProperty("gender");
user.addStringProperty("hobbies");
user.addStringProperty("jobs");
user.setSuperclass("cn.bmob.v3.BmobObject");
}
示例12: addUserAuth
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
/**
* @author:keivn
* @param schema
*/
private static void addUserAuth(Schema schema){
Entity userAuth = schema.addEntity("UserAuth");
userAuth.addIdProperty();
userAuth.addStringProperty("user_id"); //对应user的objectId
userAuth.addIntProperty("onLineType");
userAuth.addIntProperty("identity_type");
userAuth.addStringProperty("identify_unique_id ");//(手机号 邮箱 用户名或第三方应用的唯一标识)
userAuth.addStringProperty("credential"); //credential 密码凭证(站内的保存密码,站外的不保存或保存token)
userAuth.addBooleanProperty("verified"); //是否验证,三方登录默认认证了
userAuth.addLongProperty("update_time");
userAuth.setSuperclass("cn.bmob.v3.BmobObject");//别忘了加这句
}
示例13: addCommonActivitySampleProperties
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addCommonActivitySampleProperties(String superClass, Entity activitySample, Entity user, Entity device) {
activitySample.setSuperclass(superClass);
activitySample.addImport(MAIN_PACKAGE + ".devices.SampleProvider");
activitySample.setJavaDoc(
"This class represents a sample specific to the device. Values like activity kind or\n" +
"intensity, are device specific. Normalized values can be retrieved through the\n" +
"corresponding {@link SampleProvider}.");
activitySample.addIntProperty("timestamp").notNull().primaryKey();
Property deviceId = activitySample.addLongProperty("deviceId").primaryKey().getProperty();
activitySample.addToOne(device, deviceId);
Property userId = activitySample.addLongProperty("userId").getProperty();
activitySample.addToOne(user, userId);
}
示例14: addFood
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static Entity addFood(Schema schema) {
Entity food = schema.addEntity("FoodEntity");
food.setSuperclass("FoodEntityBase");
food.addIdProperty().autoincrement().primaryKey();
food.addStringProperty("name").notNull();
food.addStringProperty("brand").notNull();
food.addBooleanProperty("isDrink").notNull();
food.addDoubleProperty("calories").notNull();
food.addDoubleProperty("fats").notNull();
food.addDoubleProperty("carbohydrates").notNull();
food.addDoubleProperty("proteins").notNull();
food.addStringProperty("picture");
return food;
}
示例15: createProject
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static Entity createProject(Schema schema) {
DaoHelperMethods.EntityInformation projectInfo =
new DaoHelperMethods.EntityInformation(ModelNames.PROJECT, ModelNames.PROJECT_STRING_ATTRIBUTES);
Entity project = DaoHelperMethods.createEntity(schema, projectInfo);
project.setSuperclass(UW_DATABASE_MODEL_PROTOCOL);
return project;
}