本文整理汇总了Java中com.j256.ormlite.android.AndroidConnectionSource类的典型用法代码示例。如果您正苦于以下问题:Java AndroidConnectionSource类的具体用法?Java AndroidConnectionSource怎么用?Java AndroidConnectionSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AndroidConnectionSource类属于com.j256.ormlite.android包,在下文中一共展示了AndroidConnectionSource类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setUp
import com.j256.ormlite.android.AndroidConnectionSource; //导入依赖的package包/类
@Before
public void setUp() throws SQLException {
LmisSqliteOpenHelper.getInstance(application).close();
mockUserService = mock(UserService.class);
when(mockUserService.getRegisteredUser()).thenReturn(new User("", "", "AU"));
setUpInjection(this, new AbstractModule() {
@Override
protected void configure() {
bind(UserService.class).toInstance(mockUserService);
}
});
openHelper = LmisSqliteOpenHelper.getInstance(application);// getHelper(application, LmisSqliteOpenHelper.class);
connectionSource = new AndroidConnectionSource(openHelper);
reasonDao = createDao(connectionSource, OrderReason.class);
orderDao = createDao(connectionSource, Order.class);
orderItemDao = createDao(connectionSource, OrderItem.class);
commodityDao = createDao(connectionSource, Commodity.class);
commodityActivityDao = createDao(connectionSource, CommodityAction.class);
categoryDao = createDao(connectionSource, Category.class);
orderTypeDao = createDao(connectionSource, OrderType.class);
dataSetDao = createDao(connectionSource, DataSet.class);
snapshotGenericDao = new GenericDao<>(CommoditySnapshot.class, Robolectric.application);
}
开发者ID:clintonhealthaccess,项目名称:chailmis-android,代码行数:26,代码来源:OrderServiceTest.java
示例2: getRecordDao
import com.j256.ormlite.android.AndroidConnectionSource; //导入依赖的package包/类
public Dao<CrashInfo, Integer> getRecordDao() {
ConnectionSource connectionSource = new AndroidConnectionSource(this);
Dao<CrashInfo, Integer> dao = null;
try {
dao = getDao(CrashInfo.class);
} catch (SQLException e) {
e.printStackTrace();
}
// try {
// dao = BaseDaoImpl.createDao(connectionSource, CrashInfo.class);
// } catch (SQLException e) {
// e.printStackTrace();
// }
return dao;
}
开发者ID:fei-ke,项目名称:CrashReport,代码行数:16,代码来源:RecordDBOpenHelper.java
示例3: OrmliteDao
import com.j256.ormlite.android.AndroidConnectionSource; //导入依赖的package包/类
public OrmliteDao(Context context) throws SQLException
{
DbOpenHelper helper = new DbOpenHelper(context);
conn = new AndroidConnectionSource(helper);
init();
csDao = DaoManager.createDao(conn, CharSheet.class);
aDao = DaoManager.createDao(conn, Attributes.class);
}
开发者ID:Nemesis-Xero,项目名称:ds2-char-sheet,代码行数:11,代码来源:OrmliteDao.java
示例4: setUp
import com.j256.ormlite.android.AndroidConnectionSource; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
setUpInjectionWithMockLmisServer(application, this);
openHelper = LmisSqliteOpenHelper.getInstance(application);// getHelper(application, LmisSqliteOpenHelper.class);
connectionSource = new AndroidConnectionSource(openHelper);
commodityDao = createDao(connectionSource, Commodity.class);
stockDao = createDao(connectionSource, StockItem.class);
}
开发者ID:clintonhealthaccess,项目名称:chailmis-android,代码行数:10,代码来源:StockServiceTest.java
示例5: open
import com.j256.ormlite.android.AndroidConnectionSource; //导入依赖的package包/类
public void open() throws SQLException {// you get the SQLiteOpenHelper from your Android Activity
ConnectionSource connectionSource = new AndroidConnectionSource(dbHelper);
if (dbHelper == null) {
dbHelper = OpenHelperManager.getHelper(ctx, BookLibOpenDatabaseHelper.class);
}
}
开发者ID:mrspaceman,项目名称:ebookmgr,代码行数:7,代码来源:LibraryManager.java
示例6: get
import com.j256.ormlite.android.AndroidConnectionSource; //导入依赖的package包/类
@Override
public ConnectionSource get() {
final SQLiteDatabase sqliteDb = SQLiteDatabase.openDatabase(this.dictionaryDbPath, null, OPEN_READONLY | NO_LOCALIZED_COLLATORS);
final ConnectionSource connectionSource = new AndroidConnectionSource(sqliteDb);
return connectionSource;
}
开发者ID:ncjones,项目名称:juzidian,代码行数:7,代码来源:DictionaryConnectionSourceProvider.java
示例7: GeoPackageConnection
import com.j256.ormlite.android.AndroidConnectionSource; //导入依赖的package包/类
/**
* Constructor
*
* @param db
*/
public GeoPackageConnection(GeoPackageDatabase db) {
this.db = db;
this.connectionSource = new AndroidConnectionSource(db.getDb());
}
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:10,代码来源:GeoPackageConnection.java
注:本文中的com.j256.ormlite.android.AndroidConnectionSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论