app/src/main/java/com/example/zwy/greendaodemo/entity/BooksDao.java
public static void createTable(Database db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"books\" (" + //
                "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
                "\"BOOK_NAME\" TEXT NOT NULL ," + // 1: bookName
                "\"AUTHOR\" TEXT," + // 2: author
                "\"PRICE\" INTEGER NOT NULL );"); // 3: price
    }
/** Creates the underlying database table. */
Creates the underlying database table.
Creates the underlying database table .
public static void createTable(Database db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"books\" (" + 
                "\"_id\" INTEGER PRIMARY KEY ," +  0: id
                "\"BOOK_NAME\" TEXT NOT NULL ," +  1: bookName
                "\"AUTHOR\" TEXT," +  2: author
                "\"PRICE\" INTEGER NOT NULL );");  3: price
    }
public static void createTable ( Database db , boolean ifNotExists ) { String constraint = ifNotExists ? "IF NOT EXISTS " : "" ; db . execSQL ( "CREATE TABLE " + constraint + "\"books\" (" + "\"_id\" INTEGER PRIMARY KEY ," + "\"BOOK_NAME\" TEXT NOT NULL ," + "\"AUTHOR\" TEXT," + "\"PRICE\" INTEGER NOT NULL );" ) ; }
Creates the underlying database table.
Creates the underlying database table .
// // 0: id // 1: bookName // 2: author // 3: price