Java Code Examples for de.greenrobot.dao.internal.DaoConfig

The following examples show how to use de.greenrobot.dao.internal.DaoConfig. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: Puff-Android   Author: PuffOpenSource   File: DaoSession.java    License: MIT License 6 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
        daoConfigMap) {
    super(db);

    accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
    accountDaoConfig.initIdentityScope(type);

    categoryDaoConfig = daoConfigMap.get(CategoryDao.class).clone();
    categoryDaoConfig.initIdentityScope(type);

    acctTypeDaoConfig = daoConfigMap.get(AcctTypeDao.class).clone();
    acctTypeDaoConfig.initIdentityScope(type);

    accountDao = new AccountDao(accountDaoConfig, this);
    categoryDao = new CategoryDao(categoryDaoConfig, this);
    acctTypeDao = new AcctTypeDao(acctTypeDaoConfig, this);

    registerDao(Account.class, accountDao);
    registerDao(Category.class, categoryDao);
    registerDao(AcctType.class, acctTypeDao);
}
 
Example #2
Source Project: iBeebo   Author: andforce   File: DaoSession.java    License: GNU General Public License v3.0 6 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
        daoConfigMap) {
    super(db);

    green_AccountBeanDaoConfig = daoConfigMap.get(Green_AccountBeanDao.class).clone();
    green_AccountBeanDaoConfig.initIdentityScope(type);

    green_AtUsersBeanDaoConfig = daoConfigMap.get(Green_AtUsersBeanDao.class).clone();
    green_AtUsersBeanDaoConfig.initIdentityScope(type);

    green_TimeLineStatusDaoConfig = daoConfigMap.get(Green_TimeLineStatusDao.class).clone();
    green_TimeLineStatusDaoConfig.initIdentityScope(type);

    green_AccountBeanDao = new Green_AccountBeanDao(green_AccountBeanDaoConfig, this);
    green_AtUsersBeanDao = new Green_AtUsersBeanDao(green_AtUsersBeanDaoConfig, this);
    green_TimeLineStatusDao = new Green_TimeLineStatusDao(green_TimeLineStatusDaoConfig, this);

    registerDao(Green_AccountBean.class, green_AccountBeanDao);
    registerDao(Green_AtUsersBean.class, green_AtUsersBeanDao);
    registerDao(Green_TimeLineStatus.class, green_TimeLineStatusDao);
}
 
Example #3
Source Project: Expert-Android-Programming   Author: PacktPublishing   File: DaoSession.java    License: MIT License 6 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
        daoConfigMap) {
    super(db);

    //MEMBERS ITEM
    restaurantImageDaoConfig = daoConfigMap.get(RestaurantImageDao.class).clone();
    restaurantImageDaoConfig.initIdentityScope(type);
    restaurantImageDao = new RestaurantImageDao(restaurantImageDaoConfig, this);
    registerDao(RestaurantImage.class, restaurantImageDao);

    //MEMBERS ITEM
    photoItemDaoConfig = daoConfigMap.get(PhotoItemDao.class).clone();
    photoItemDaoConfig.initIdentityScope(type);
    photoItemDao = new PhotoItemDao(photoItemDaoConfig, this);
    registerDao(PhotoItem.class, photoItemDao);

    //TODO ADD HERE
}
 
Example #4
Source Project: SweetMusicPlayer   Author: WellerV   File: DaoSession.java    License: Apache License 2.0 6 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
        daoConfigMap) {
    super(db);

    musicInfoDaoConfig = daoConfigMap.get(MusicInfoDao.class).clone();
    musicInfoDaoConfig.initIdentityScope(type);

    albumInfoDaoConfig = daoConfigMap.get(AlbumInfoDao.class).clone();
    albumInfoDaoConfig.initIdentityScope(type);

    artistInfoDaoConfig = daoConfigMap.get(ArtistInfoDao.class).clone();
    artistInfoDaoConfig.initIdentityScope(type);

    musicInfoDao = new MusicInfoDao(musicInfoDaoConfig, this);
    albumInfoDao = new AlbumInfoDao(albumInfoDaoConfig, this);
    artistInfoDao = new ArtistInfoDao(artistInfoDaoConfig, this);

    registerDao(MusicInfo.class, musicInfoDao);
    registerDao(AlbumInfo.class, albumInfoDao);
    registerDao(ArtistInfo.class, artistInfoDao);
}
 
Example #5
Source Project: MinMinGuard   Author: chiehmin   File: DaoSession.java    License: GNU General Public License v3.0 5 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig> daoConfigMap)
{
    super(db);

    appDataDaoConfig = daoConfigMap.get(AppDataDao.class).clone();
    appDataDaoConfig.initIdentityScope(type);

    appDataDao = new AppDataDao(appDataDaoConfig, this);

    registerDao(AppData.class, appDataDao);
}
 
Example #6
Source Project: AndroidQuick   Author: ddnosh   File: UserDao.java    License: MIT License 4 votes vote down vote up
public UserDao(DaoConfig config) {
    super(config);
}
 
Example #7
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: PictureCacheDao.java    License: Apache License 2.0 4 votes vote down vote up
public PictureCacheDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #8
Source Project: Yahala-Messenger   Author: wmhameed   File: MessagesDao.java    License: MIT License 4 votes vote down vote up
public MessagesDao(DaoConfig config) {
    super(config);
}
 
Example #9
Source Project: MyWeather   Author: ghbhaha   File: HourForeCastDao.java    License: Apache License 2.0 4 votes vote down vote up
public HourForeCastDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #10
Source Project: Yahala-Messenger   Author: wmhameed   File: UserSettingDao.java    License: MIT License 4 votes vote down vote up
public UserSettingDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #11
Source Project: TLint   Author: gzsll   File: ForumDao.java    License: Apache License 2.0 4 votes vote down vote up
public ForumDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #12
Source Project: FoodOrdering   Author: yangxch   File: RealWeatherDao.java    License: Apache License 2.0 4 votes vote down vote up
public RealWeatherDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #13
Source Project: JianDan   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 4 votes vote down vote up
public SisterCacheDao(DaoConfig config) {
    super(config);
}
 
Example #14
Source Project: FoodOrdering   Author: yangxch   File: AlarmsDao.java    License: Apache License 2.0 4 votes vote down vote up
public AlarmsDao(DaoConfig config) {
    super(config);
}
 
Example #15
Source Project: AndroidDatabaseLibraryComparison   Author: Rightpoint   File: AddressItemDao.java    License: MIT License 4 votes vote down vote up
public AddressItemDao(DaoConfig config) {
    super(config);
}
 
Example #16
Source Project: NBAPlus   Author: SilenceDut   File: GreenNewsDao.java    License: Apache License 2.0 4 votes vote down vote up
public GreenNewsDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #17
Source Project: AndroidDatabaseLibraryComparison   Author: Rightpoint   File: SimpleAddressItemDao.java    License: MIT License 4 votes vote down vote up
public SimpleAddressItemDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #18
Source Project: iBeebo   Author: andforce   File: Green_AtUsersBeanDao.java    License: GNU General Public License v3.0 4 votes vote down vote up
public Green_AtUsersBeanDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #19
Source Project: SweetMusicPlayer   Author: WellerV   File: AlbumInfoDao.java    License: Apache License 2.0 4 votes vote down vote up
public AlbumInfoDao(DaoConfig config) {
    super(config);
}
 
Example #20
Source Project: Yahala-Messenger   Author: wmhameed   File: ContactsDao.java    License: MIT License 4 votes vote down vote up
public ContactsDao(DaoConfig config) {
    super(config);
}
 
Example #21
Source Project: Maps   Author: andforce   File: BJCameraDao.java    License: GNU General Public License v2.0 4 votes vote down vote up
public BJCameraDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #22
Source Project: RxJavaApp   Author: jiang111   File: alloperatorsDao.java    License: Apache License 2.0 4 votes vote down vote up
public alloperatorsDao(DaoConfig config) {
    super(config);
}
 
Example #23
Source Project: FoodOrdering   Author: yangxch   File: HourForeCastDao.java    License: Apache License 2.0 4 votes vote down vote up
public HourForeCastDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #24
Source Project: DMusic   Author: Dsiner   File: TransferModelDao.java    License: Apache License 2.0 4 votes vote down vote up
public TransferModelDao(DaoConfig config) {
    super(config);
}
 
Example #25
Source Project: MeiZiNews   Author: qq137712630   File: MigrationHelper.java    License: MIT License 4 votes vote down vote up
private void generateTempTables(SQLiteDatabase db, Class<? extends AbstractDao<?, ?>>... daoClasses) {
    for(int i = 0; i < daoClasses.length; i++) {
        DaoConfig daoConfig = new DaoConfig(db, daoClasses[i]);

        String divider = "";
        String tableName = daoConfig.tablename;
        String tempTableName = daoConfig.tablename.concat("_TEMP");
        ArrayList<String> properties = new ArrayList<>();

        StringBuilder createTableStringBuilder = new StringBuilder();

        createTableStringBuilder.append("CREATE TABLE ").append(tempTableName).append(" (");

        for(int j = 0; j < daoConfig.properties.length; j++) {
            String columnName = daoConfig.properties[j].columnName;

            if(getColumns(db, tableName).contains(columnName)) {
                properties.add(columnName);

                String type = null;

                try {
                    type = getTypeByClass(daoConfig.properties[j].type);
                } catch (Exception exception) {
                    Log.e("MigrationHelper", exception.toString());
                }

                createTableStringBuilder.append(divider).append(columnName).append(" ").append(type);

                if(daoConfig.properties[j].primaryKey) {
                    createTableStringBuilder.append(" PRIMARY KEY");
                }

                divider = ",";
            }
        }
        createTableStringBuilder.append(");");

        db.execSQL(createTableStringBuilder.toString());

        StringBuilder insertTableStringBuilder = new StringBuilder();

        insertTableStringBuilder.append("INSERT INTO ").append(tempTableName).append(" (");
        insertTableStringBuilder.append(TextUtils.join(",", properties));
        insertTableStringBuilder.append(") SELECT ");
        insertTableStringBuilder.append(TextUtils.join(",", properties));
        insertTableStringBuilder.append(" FROM ").append(tableName).append(";");

        db.execSQL(insertTableStringBuilder.toString());
    }
}
 
Example #26
Source Project: DMusic   Author: Dsiner   File: CustomMusic4Dao.java    License: Apache License 2.0 4 votes vote down vote up
public CustomMusic4Dao(DaoConfig config) {
    super(config);
}
 
Example #27
Source Project: Puff-Android   Author: PuffOpenSource   File: AcctTypeDao.java    License: MIT License 4 votes vote down vote up
public AcctTypeDao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #28
Source Project: DMusic   Author: Dsiner   File: CustomMusic14Dao.java    License: Apache License 2.0 4 votes vote down vote up
public CustomMusic14Dao(DaoConfig config, DaoSession daoSession) {
    super(config, daoSession);
}
 
Example #29
Source Project: MyWeather   Author: ghbhaha   File: RealWeatherDao.java    License: Apache License 2.0 4 votes vote down vote up
public RealWeatherDao(DaoConfig config) {
    super(config);
}
 
Example #30
Source Project: AndroidDatabaseLibraryComparison   Author: Rightpoint   File: SimpleAddressItemDao.java    License: MIT License 4 votes vote down vote up
public SimpleAddressItemDao(DaoConfig config) {
    super(config);
}