データベース構造:
public final class ManufacturersColumns implements MyStyleBaseColumns {
public static final String ALIAS = "alias";
public static final String MANUFACTURER_ID = "manufacturer_id";
public static final String NAME = "name";
public static final String TABLE_NAME = "manufacturers";
public static final String CREATE_TABLE =
"CREATE TABLE " + TABLE_NAME + "( "
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ ALIAS + " TEXT, "
+ DATE_DELETED + " DATE, "
+ DATE_CREATED + " DATE, "
+ DATE_MODIFIED + " DATE, "
+ MANUFACTURER_ID + " TEXT, "
+ NAME + " TEXT "
+ ");";}
public final class ManufacturersUserCreatedColumns implements MyStyleBaseColumns {
public static final String MANUFACTURER_ID = "manufacturer_id";
public static final String NAME = "name";
public static final String TABLE_NAME = "manufacturers_user_created";
public static final String CREATE_TABLE =
"CREATE TABLE " + TABLE_NAME + "( "
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ MANUFACTURER_ID + " TEXT, "
+ NAME + " TEXT, "
+ DATE_CREATED + " DATE, "
+ DATE_MODIFIED + " DATE, "
+ DATE_DELETED + " DATE, "
+ SYNC_FLAG + " NUMERIC "
+ ");";
}
ここで、名前をリストするために以下のクエリを使用しています。
<string name="kGetAllManufacturers"><![CDATA["SELECT _id, manufacturer_id, name, alias, usergen FROM (SELECT _id, manufacturer_id, name, alias, 0 AS usergen FROM manufacturers UNION SELECT _id, manufacturer_id, name, '' AS alias, 1 AS usergen FROM manufacturers_user_created) main ORDER BY lower(name) ASC"]]>
要件は次のとおりです。
上部で頻繁に選択されるリスト名の上記のクエリを変更する必要があります。
前もって感謝します。