PRIMARY KEY
TABLE_LIENS_TAG_PAGE
中有2列和2个外键:
private final static String CREATE_TABLE_LIENS_TAG_PAGE =
"CREATE TABLE " + TABLE_LIENS_TAG_PAGE + " ("
+ COL_ID_PAGE_LTP + " INTEGER NOT NULL , "
+ COL_ID_TAG_LTP + " INTEGER NOT NULL , "
+ " PRIMARY KEY (" + COL_ID_PAGE_LTP +" "+ COL_ID_TAG_LTP +")"
+ " FOREIGN KEY ("+ COL_ID_PAGE_LTP +") REFERENCES "+ TABLE_PAGE +"("+ COL_ID_PAGE+")"
+ " FOREIGN KEY ("+ COL_ID_TAG_LTP +") REFERENCES "+ TABLE_TAG +"("+ COL_ID_TAG +"));";
见table_ Page
public final static String TABLE_PAGE = "tb_page";
public final static String COL_ID_PAGE = "id_page";
public final static String COL_TITLE_PAGE = "titre_page";
public final static String COL_DATE_PAGE = "date_page";
private final static String CREATE_TABLE_PAGE=
"CREATE TABLE " + TABLE_PAGE + " ("
+ COL_ID_PAGE + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ COL_TITLE_PAGE + " TEXT NOT NULL ,"
+ COL_DATE_PAGE + " DATE );";
和table_tag
public final static String TABLE_TAG = "tb_tag";
public final static String COL_ID_TAG = "id_tag";
public final static String COL_TEXTE_TAG = "texte_tag";
private final static String CREATE_TABLE_TAG=
"CREATE TABLE " + TABLE_TAG + " ("
+ COL_ID_TAG + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ COL_TEXTE_TAG + " TEXT );";