当前位置: 首页>>代码示例>>Java>>正文


Java OpenHelperManager.getHelper方法代码示例

本文整理汇总了Java中com.j256.ormlite.android.apptools.OpenHelperManager.getHelper方法的典型用法代码示例。如果您正苦于以下问题:Java OpenHelperManager.getHelper方法的具体用法?Java OpenHelperManager.getHelper怎么用?Java OpenHelperManager.getHelper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.j256.ormlite.android.apptools.OpenHelperManager的用法示例。


在下文中一共展示了OpenHelperManager.getHelper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DaoManager

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
private DaoManager(Context context){

		if (helper == null) {
			helper = OpenHelperManager.getHelper(context, DataBaseHelper.class);
		}

		try {
			dao_contact = helper.getContactsDao();
			dao_userConversation = helper.getUserConversationDao();
			dao_session = helper.getSessionDao();
			dao_message = helper.getMessageDao();
			dao_sessionMember = helper.getSessionMemberDao();
			dao_userSession = helper.getUserSessionDao();
			dao_timeStamp = helper.getTimeStampDao();
			dao_user = helper.getUserDao();
			dao_emoji = helper.getEmojiDao();
			dao_webValue = helper.getWebValueDao();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
 
开发者ID:yun2win,项目名称:yun2win-sdk-android,代码行数:23,代码来源:DaoManager.java

示例2: onCreate

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	database = OpenHelperManager.getHelper(this, DatabaseHelper.class);

	// Set the custom toolbar
	final Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
	setSupportActionBar(toolbar);
	getSupportActionBar().setLogo(R.mipmap.ic_launcher);
	
	floatingButton = (FloatingActionButton) findViewById(R.id.floatingButton);

	if (savedInstanceState == null) {
		getFragmentManager().beginTransaction().add(R.id.container, new ServersListFragment()).commit();
	}
	getFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
		@Override
		public void onBackStackChanged() {
			shouldDisplayNavigateUp();
		}
	});
	shouldDisplayNavigateUp();
}
 
开发者ID:sylvain121,项目名称:Xpra-client-android,代码行数:25,代码来源:MainActivity.java

示例3: doInBackground

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
@Override
protected Void doInBackground(Void... voids) {
    ArrayList<Track> mTrackList = Utils.musicLoader(mContext);
    OrmHandler ormHandler = OpenHelperManager.getHelper(mContext, OrmHandler.class);
    try {
        Dao<Track, String> dbTrack = ormHandler.getDao(Track.class);
        List<Track> _temp = dbTrack.queryForAll();
        _temp.removeAll(mTrackList);
        for (Track t :
                mTrackList) {
            dbTrack.createIfNotExists(t);
        }
        dbTrack.delete(_temp);
    } catch (SQLException e) {
        e.printStackTrace();
    }
    OpenHelperManager.releaseHelper();
    return null;
}
 
开发者ID:Circle-Of-Music-Makers,项目名称:com-android,代码行数:20,代码来源:DatabaseSynchronization.java

示例4: bucketOps

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
public static void bucketOps(String path, Boolean bucket, Context mContext) {
    final OrmHandler ormHandler = OpenHelperManager.getHelper(mContext, OrmHandler.class);
    try {
        Dao<Track, String> dbTrack = ormHandler.getDao(Track.class);
        QueryBuilder<Track, String> queryBuilder = dbTrack.queryBuilder();
        SelectArg selectArg = new SelectArg();
        queryBuilder.where().eq("path", selectArg);
        PreparedQuery<Track> preparedQuery = queryBuilder.prepare();
        selectArg.setValue(path);
        List<Track> lister = dbTrack.query(preparedQuery);
        Track temp_track = lister.get(0);
        temp_track.setBucket(bucket);
        dbTrack.update(temp_track);
        BUCKET_OPS = true;
    } catch (SQLException | IndexOutOfBoundsException e) {
        e.printStackTrace();
    }
}
 
开发者ID:Circle-Of-Music-Makers,项目名称:com-android,代码行数:19,代码来源:Utils.java

示例5: onCreate

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
@Override
    public void onCreate() {
        super.onCreate();
//        This is here because onStart is not called when BIND_AUTO_CREATE is used
        mContext = this;
        localBroadcastManager = LocalBroadcastManager.getInstance(this);
        final OrmHandler ormHandler = OpenHelperManager.getHelper(this, OrmHandler.class);
        Dao<Track, String> dbTrack;
        try {
            dbTrack = ormHandler.getDao(Track.class);
            mTrackList = dbTrack.queryForAll();
            mBucketList = dbTrack.queryForEq("bucket", true);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
 
开发者ID:Circle-Of-Music-Makers,项目名称:com-android,代码行数:17,代码来源:MusicPlayerService.java

示例6: getDiaryTalks

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
public static List<Talk> getDiaryTalks(Context context){
    DataBaseHelper dataBaseHelper = OpenHelperManager.getHelper(context, DataBaseHelper.class);
    try {
        QueryBuilder<Talk, String> builder = dataBaseHelper.getTalkDao().queryBuilder();
        builder.orderBy("order",true);
        Where<Talk,String> where = builder.where();
        where.eq("scheduled", true);
        List<Talk> talkList = builder.query();
        if(!talkList.isEmpty() && talkList!=null) {
            return talkList;
        }
    } catch (SQLException e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:viniciusDSL,项目名称:Google-I-O-extended,代码行数:17,代码来源:TalkController.java

示例7: doInBackground

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
@Override
protected Launch doInBackground( final Integer... ids )
{
	Launch launch = null;

	if( m_context != null )
	{
		final DatabaseHelper databaseHelper = OpenHelperManager.getHelper( m_context, DatabaseHelper.class );
		if( databaseHelper != null )
		{
			try
			{
				Dao<Launch, Integer> launchDao = databaseHelper.getDao( Launch.class );
				launch = launchDao.queryForId( ids[ 0 ] );
			}
			catch( final SQLException e )
			{
				e.printStackTrace();
			}

			OpenHelperManager.releaseHelper();
		}
	}

	return launch;
}
 
开发者ID:Wavesonics,项目名称:TMinus,代码行数:27,代码来源:LaunchLoader.java

示例8: searchMangaByCover

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
private static Manga searchMangaByCover(String cover){

        DatabaseHelper dbs = OpenHelperManager.getHelper(
                App.getInstance().getApplicationContext(),
                DatabaseHelper.class);
        Manga manga = null;
        try {
            manga = dbs.getMangaRunDao().queryBuilder().where().eq(Manga.COVER_COLUMN_NAME, cover)
                    .queryForFirst();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            OpenHelperManager.releaseHelper();
        }

        return manga;
    }
 
开发者ID:Vrael,项目名称:eManga,代码行数:18,代码来源:CoverListener.java

示例9: openDB

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
public static void openDB(final Context ctx) {

	Runnable r = new Runnable() {
		@Override
		public void run() {
               BackupUtil.backuprestore();
			Globo.dbHelper = OpenHelperManager.getHelper(ctx, DatabaseHelper.class);
			Globo.db = Globo.dbHelper.getWritableDatabase();				
		}
	};
	Globo.dbHandler.post(r);		
	
}
 
开发者ID:jarro,项目名称:ircradio,代码行数:14,代码来源:DBUtil.java

示例10: queriedTracks

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
public void queriedTracks(String query) {
    OrmHandler orm = OpenHelperManager.getHelper(mContext, OrmHandler.class);
    try {
        Dao<Track, String> mTrack = orm.getDao(Track.class);
        QueryBuilder<Track, String> queryBuilder = mTrack.queryBuilder();
        queryBuilder.where().like("name", "%" + query + "%").or().like("artist", "%" + query + "%").or().like("album", "%" + query + "%");
        PreparedQuery<Track> preparedQuery = queryBuilder.prepare();
        mTrackList = mTrack.query(preparedQuery);
    } catch (SQLException e) {
        e.printStackTrace();
    }
    OpenHelperManager.releaseHelper();
    notifyDataSetChanged();
}
 
开发者ID:Circle-Of-Music-Makers,项目名称:com-android,代码行数:15,代码来源:TracksAdapter.java

示例11: getBucketedTracks

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
public void getBucketedTracks() {
    bucketBool = true;
    OrmHandler orm = OpenHelperManager.getHelper(mContext, OrmHandler.class);
    try {
        Dao<Track, String> mTrack = orm.getDao(Track.class);
        mTrackList = mTrack.queryForEq("bucket", true);
    } catch (SQLException e) {
        e.printStackTrace();
    }
    OpenHelperManager.releaseHelper();
    notifyDataSetChanged();
}
 
开发者ID:Circle-Of-Music-Makers,项目名称:com-android,代码行数:13,代码来源:TracksAdapter.java

示例12: initChannelId

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
private void initChannelId() {
    ORMLiteDBHelper helper = OpenHelperManager.getHelper(getContext(), ORMLiteDBHelper.class);
    try {
        ChannelDao channelDao =
                new ChannelDao(((Dao<Channel, Integer> ) helper.getDao(Channel.class)));

        Channel okChannel = channelDao.getOkChannel();

        if (okChannel != null) {
            tvChannelId.setText(String.valueOf(okChannel.cId));
        }
    } catch (SQLException e) {
        Log.e("AddressBatchActivity_", "Could not create DAO addressBatchDao", e);
    }
}
 
开发者ID:chaincloud-dot-com,项目名称:chaincloud-v,代码行数:16,代码来源:MessageFragment.java

示例13: getAddressDao

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
private AddressDao getAddressDao(){
    try {
        ORMLiteDBHelper ormLiteDBHelper = OpenHelperManager.getHelper(this, ORMLiteDBHelper.class);

        return new AddressDao(((Dao<Address, Integer>) ormLiteDBHelper
                .getDao(Address.class)));
    } catch (SQLException e) {
        log.error("Could not create DAO", e);
    }

    return null;
}
 
开发者ID:chaincloud-dot-com,项目名称:chaincloud-v,代码行数:13,代码来源:SMSServiceImpl.java

示例14: getAddressBatchDao

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
private AddressBatchDao getAddressBatchDao(){
    try {
        ORMLiteDBHelper ormLiteDBHelper = OpenHelperManager.getHelper(this, ORMLiteDBHelper.class);

        return new AddressBatchDao(((Dao<AddressBatch, Integer>) ormLiteDBHelper
                .getDao(AddressBatch.class)));
    } catch (SQLException e) {
        log.error("Could not create DAO", e);
    }

    return null;
}
 
开发者ID:chaincloud-dot-com,项目名称:chaincloud-v,代码行数:13,代码来源:SMSServiceImpl.java

示例15: getTalkById

import com.j256.ormlite.android.apptools.OpenHelperManager; //导入方法依赖的package包/类
public static Talk getTalkById(Context context,String talkId){
    DataBaseHelper dataBaseHelper = OpenHelperManager.getHelper(context, DataBaseHelper.class);
    Talk result;
    try {
        result = dataBaseHelper.getTalkDao().queryForId(talkId);
    } catch (SQLException e) {
        e.printStackTrace();
        result = null;
    }
    return result;
}
 
开发者ID:viniciusDSL,项目名称:Google-I-O-extended,代码行数:12,代码来源:TalkController.java


注:本文中的com.j256.ormlite.android.apptools.OpenHelperManager.getHelper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。