本文整理汇总了Java中de.greenrobot.daogenerator.Entity.setTableName方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.setTableName方法的具体用法?Java Entity.setTableName怎么用?Java Entity.setTableName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.greenrobot.daogenerator.Entity
的用法示例。
在下文中一共展示了Entity.setTableName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDepartment
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addDepartment(Schema schema){
Entity department = schema.addEntity("DepartmentEntity");
department.setTableName("Department");
department.setClassNameDao("DepartmentDao");
department.setJavaPackage(entityPath);
department.addIdProperty().autoincrement();
department.addIntProperty("departId").unique().notNull().index();
department.addStringProperty("departName").unique().notNull().index();
department.addIntProperty("priority").notNull();
department.addIntProperty("status").notNull();
department.addIntProperty("created").notNull();
department.addIntProperty("updated").notNull();
department.setHasKeepSections(true);
}
示例2: addGroupInfo
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addGroupInfo(Schema schema) {
Entity groupInfo = schema.addEntity("GroupEntity");
groupInfo.setTableName("GroupInfo");
groupInfo.setClassNameDao("GroupDao");
groupInfo.setJavaPackage(entityPath);
groupInfo.addIdProperty().autoincrement();
groupInfo.addIntProperty("peerId").unique().notNull();
groupInfo.addIntProperty("groupType").notNull();
groupInfo.addStringProperty("mainName").notNull();
groupInfo.addStringProperty("avatar").notNull();
groupInfo.addIntProperty("creatorId").notNull();
groupInfo.addIntProperty("userCnt").notNull();
groupInfo.addStringProperty("userList").notNull();
groupInfo.addIntProperty("version").notNull();
groupInfo.addIntProperty("status").notNull();
groupInfo.addIntProperty("created").notNull();
groupInfo.addIntProperty("updated").notNull();
groupInfo.setHasKeepSections(true);
}
示例3: addSessionInfo
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addSessionInfo(Schema schema){
Entity sessionInfo = schema.addEntity("SessionEntity");
sessionInfo.setTableName("Session");
sessionInfo.setClassNameDao("SessionDao");
sessionInfo.setJavaPackage(entityPath);
//point to userId/groupId need sessionType 区分
sessionInfo.addIdProperty().autoincrement();
sessionInfo.addStringProperty("sessionKey").unique().notNull(); //.unique()
sessionInfo.addIntProperty("peerId").notNull();
sessionInfo.addIntProperty("peerType").notNull();
sessionInfo.addIntProperty("latestMsgType").notNull();
sessionInfo.addIntProperty("latestMsgId").notNull();
sessionInfo.addStringProperty("latestMsgData").notNull();
sessionInfo.addIntProperty("talkId").notNull();
sessionInfo.addIntProperty("created").notNull();
sessionInfo.addIntProperty("updated").notNull();
sessionInfo.setHasKeepSections(true);
}
示例4: addCustomerOrder
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
/**
* @author:keivn
* @param schema
*/
private static void addCustomerOrder(Schema schema) {
Entity customer = schema.addEntity("Customer");
customer.addIdProperty();
customer.addStringProperty("name").notNull();
Entity order = schema.addEntity("Order");
order.setTableName("ORDERS"); // "ORDER" is a reserved keyword
order.addIdProperty();
Property orderDate = order.addDateProperty("date").getProperty();
Property customerId = order.addLongProperty("customerId").notNull().getProperty();
order.addToOne(customer, customerId);
ToMany customerToOrders = customer.addToMany(order, customerId);
customerToOrders.setName("orders");
customerToOrders.orderAsc(orderDate);
}
示例5: addPrinter
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static Entity addPrinter(Schema schema) {
Entity printer = schema.addEntity("PrinterDbEntity");
printer.setTableName("PRINTER");
printer.addIdProperty().primaryKey().unique();
printer.addStringProperty("name").notNull().unique();
printer.addStringProperty("apiKey").columnName("api_key").notNull();
printer.addStringProperty("scheme").notNull();
printer.addStringProperty("host").notNull();
printer.addIntProperty("port").notNull();
printer.addStringProperty("websocketPath").columnName("websocket_path").notNull();
printer.addStringProperty("webcamPathQuery").columnName("webcam_path_query").notNull();
printer.addStringProperty("uploadLocation").columnName("upload_location").notNull();
printer.addStringProperty("versionJson").columnName("version_json");
printer.addStringProperty("connectionJson").columnName("connection_json");
printer.addStringProperty("printerStateJson").columnName("printer_state_json");
printer.addStringProperty("filesJson").columnName("files_json");
return printer;
}
示例6: addHttpCookie
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addHttpCookie(Schema schema) {
Entity entity = schema.addEntity("HttpCookieRaw");
entity.setTableName("HTTP_COOKIE");
entity.setClassNameDao("HttpCookieDao");
entity.addIdProperty();
entity.addStringProperty("name");
entity.addStringProperty("value");
entity.addStringProperty("comment");
entity.addStringProperty("commentURL");
entity.addBooleanProperty("discard");
entity.addStringProperty("domain");
entity.addLongProperty("maxAge");
entity.addStringProperty("path");
entity.addStringProperty("portList");
entity.addBooleanProperty("secure");
entity.addIntProperty("version");
entity.addStringProperty("url");
entity.addLongProperty("whenCreated");
}
示例7: addAccountTable
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addAccountTable(Schema schema) {
Entity table = schema.addEntity("Green_AccountBean");
table.setHasKeepSections(true);
table.setTableName(AccountTable.ACCOUNT_TABLE);
table.implementsSerializable();
table.addLongProperty(AccountTable.UID).primaryKey();
table.addStringProperty(AccountTable.USER_NAME);
table.addStringProperty(AccountTable.USER_PWD);
table.addStringProperty(AccountTable.COOKIE);
table.addStringProperty(AccountTable.OAUTH_TOKEN);
table.addLongProperty(AccountTable.OAUTH_TOKEN_EXPIRES_TIME);
table.addStringProperty(AccountTable.ACCESS_TOKEN_HACK);
table.addLongProperty(AccountTable.ACCESS_TOKEN_HACK_EXPIRES_TIME);
table.addStringProperty(AccountTable.G_SID);
table.addIntProperty(AccountTable.NAVIGATION_POSITION);
table.addStringProperty(AccountTable.USER_INFO_JSON);
}
示例8: addCustomerOrder
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addCustomerOrder(Schema schema) {
Entity customer = schema.addEntity("Customer");
customer.addIdProperty();
customer.addStringProperty("name").notNull();
Entity order = schema.addEntity("Order");
order.setTableName("ORDERS"); // "ORDER" is a reserved keyword
order.addIdProperty();
Property orderDate = order.addDateProperty("date").getProperty();
Property customerId = order.addLongProperty("customerId").notNull().getProperty();
order.addToOne(customer, customerId);
ToMany customerToOrders = customer.addToMany(order, customerId);
customerToOrders.setName("orders");
customerToOrders.orderAsc(orderDate);
}
示例9: 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");
}
示例10: 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();
}
示例11: 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();
}
示例12: 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();
}
示例13: main
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {
Schema schema = new Schema(3, "greendao");
Entity verses = schema.addEntity("Verse");
verses.setTableName("verses");
verses.addIdProperty().columnName("_rowid_");
verses.addIntProperty("chapter");
verses.addIntProperty("verse");
verses.addStringProperty("book");
verses.addStringProperty("header");
verses.addStringProperty("subheader");
verses.addStringProperty("text");
Entity books = schema.addEntity("Book");
books.addLongProperty("indice").primaryKey().unique();
books.setTableName("books");
books.addStringProperty("name");
books.addStringProperty("abbreviation");
books.addStringProperty("testament");
new DaoGenerator().generateAll(schema, args[0]);
}
示例14: addUserInfo
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
private static void addUserInfo(Schema schema) {
Entity userInfo = schema.addEntity("UserEntity");
userInfo.setTableName("UserInfo");
userInfo.setClassNameDao("UserDao");
userInfo.setJavaPackage(entityPath);
userInfo.addIdProperty().autoincrement();
userInfo.addIntProperty("peerId").unique().notNull().index();
userInfo.addIntProperty("gender").notNull();
userInfo.addStringProperty("mainName").notNull();
// 这个可以自动生成pinyin
userInfo.addStringProperty("pinyinName").notNull();
userInfo.addStringProperty("realName").notNull();
userInfo.addStringProperty("avatar").notNull();
userInfo.addStringProperty("phone").notNull();
userInfo.addStringProperty("email").notNull();
userInfo.addIntProperty("departmentId").notNull();
userInfo.addIntProperty("status").notNull();
userInfo.addIntProperty("created").notNull();
userInfo.addIntProperty("updated").notNull();
userInfo.setHasKeepSections(true);
//todo 索引还没有设定
// 一对一 addToOne 的使用
// 支持protobuf
// schema.addProtobufEntity();
}
示例15: main
import de.greenrobot.daogenerator.Entity; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {
Schema schema = new Schema(1, "com.coolerfall.lunarlite.data.db.model");
Entity almanac = schema.addEntity("Almanac");
almanac.setTableName("almanac");
almanac.addIntProperty("wielding").columnName("wielding");
almanac.addIntProperty("hseb").columnName("hseb");
almanac.addStringProperty("dread").columnName("dread");
almanac.addStringProperty("suit").columnName("suit");
/* generate all dao */
new DaoGenerator().generateAll(schema, args[0]);
}