com.j256.ormlite.dao.BaseDaoImpl Java Examples

The following examples show how to use com.j256.ormlite.dao.BaseDaoImpl. 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 File: BaseCoreTest.java    From ormlite-core with ISC License 6 votes vote down vote up
private <T, ID> Dao<T, ID> configDao(BaseDaoImpl<T, ID> dao, boolean createTable) throws SQLException {
	if (connectionSource == null) {
		throw new SQLException("Connection source is null");
	}
	if (createTable) {
		DatabaseTableConfig<T> tableConfig = dao.getTableConfig();
		if (tableConfig == null) {
			tableConfig = DatabaseTableConfig.fromClass(databaseType, dao.getDataClass());
		}
		if (tableConfig.getSchemaName() != null && tableConfig.getSchemaName().length() > 0){
			createSchema(tableConfig);
		}
		createTable(tableConfig, true);
	}
	return dao;
}
 
Example #2
Source File: WhereTest.java    From ormlite-core with ISC License 6 votes vote down vote up
@Test
public void testNotExistsSubQuery() throws Exception {
	TableInfo<ForeignFoo, Integer> tableInfo = new TableInfo<ForeignFoo, Integer>(databaseType, ForeignFoo.class);
	Where<ForeignFoo, Integer> where = new Where<ForeignFoo, Integer>(tableInfo, null, databaseType);
	BaseDaoImpl<ForeignFoo, Integer> foreignDao =
			new BaseDaoImpl<ForeignFoo, Integer>(connectionSource, ForeignFoo.class) {
			};
	QueryBuilder<ForeignFoo, Integer> qb = foreignDao.queryBuilder();
	where.not().exists(qb);
	StringBuilder whereSb = new StringBuilder();
	where.appendSql(null, whereSb, new ArrayList<ArgumentHolder>());
	StringBuilder sb = new StringBuilder();
	sb.append("(NOT EXISTS (");
	sb.append("SELECT * FROM ");
	databaseType.appendEscapedEntityName(sb, tableInfo.getTableName());
	sb.append(" ) ) ");
	assertEquals(sb.toString(), whereSb.toString());
}
 
Example #3
Source File: WhereTest.java    From ormlite-core with ISC License 6 votes vote down vote up
@Test
public void testExistsSubQuery() throws Exception {
	TableInfo<ForeignFoo, Integer> tableInfo = new TableInfo<ForeignFoo, Integer>(databaseType, ForeignFoo.class);
	Where<ForeignFoo, Integer> where = new Where<ForeignFoo, Integer>(tableInfo, null, databaseType);
	BaseDaoImpl<ForeignFoo, Integer> foreignDao =
			new BaseDaoImpl<ForeignFoo, Integer>(connectionSource, ForeignFoo.class) {
			};
	QueryBuilder<ForeignFoo, Integer> qb = foreignDao.queryBuilder();
	where.exists(qb);
	StringBuilder whereSb = new StringBuilder();
	where.appendSql(null, whereSb, new ArrayList<ArgumentHolder>());
	StringBuilder sb = new StringBuilder();
	sb.append("EXISTS (");
	sb.append("SELECT * FROM ");
	databaseType.appendEscapedEntityName(sb, tableInfo.getTableName());
	sb.append(" ) ");
	assertEquals(sb.toString(), whereSb.toString());
}
 
Example #4
Source File: WhereTest.java    From ormlite-core with ISC License 6 votes vote down vote up
@Test
public void testInSubQuery() throws Exception {
	TableInfo<ForeignFoo, Integer> tableInfo = new TableInfo<ForeignFoo, Integer>(databaseType, ForeignFoo.class);
	Where<ForeignFoo, Integer> where = new Where<ForeignFoo, Integer>(tableInfo, null, databaseType);
	BaseDaoImpl<ForeignFoo, Integer> foreignDao =
			new BaseDaoImpl<ForeignFoo, Integer>(connectionSource, ForeignFoo.class) {
			};
	QueryBuilder<ForeignFoo, Integer> qb = foreignDao.queryBuilder();
	qb.selectColumns(ID_COLUMN_NAME);
	where.in(ID_COLUMN_NAME, qb);
	StringBuilder whereSb = new StringBuilder();
	where.appendSql(null, whereSb, new ArrayList<ArgumentHolder>());
	StringBuilder sb = new StringBuilder();
	databaseType.appendEscapedEntityName(sb, ID_COLUMN_NAME);
	sb.append(" IN (");
	sb.append("SELECT ");
	databaseType.appendEscapedEntityName(sb, ID_COLUMN_NAME);
	sb.append(" FROM ");
	databaseType.appendEscapedEntityName(sb, tableInfo.getTableName());
	sb.append(" ) ");
	assertEquals(sb.toString(), whereSb.toString());
}
 
Example #5
Source File: WhereTest.java    From ormlite-core with ISC License 6 votes vote down vote up
@Test
public void testIdEqObjectId() throws Exception {
	FooId foo = new FooId();
	int id = 112132;
	foo.id = id;
	Where<FooId, Integer> where =
			new Where<FooId, Integer>(new TableInfo<FooId, Integer>(databaseType, FooId.class), null, databaseType);
	BaseDaoImpl<FooId, Integer> fooDao = new BaseDaoImpl<FooId, Integer>(connectionSource, FooId.class) {
	};
	where.idEq(fooDao, foo);
	StringBuilder whereSb = new StringBuilder();
	where.appendSql(null, whereSb, new ArrayList<ArgumentHolder>());
	StringBuilder sb = new StringBuilder();
	databaseType.appendEscapedEntityName(sb, ID_COLUMN_NAME);
	sb.append(" = ").append(id);
	sb.append(' ');
	assertEquals(sb.toString(), whereSb.toString());
}
 
Example #6
Source File: StatementExecutor.java    From ormlite-core with ISC License 6 votes vote down vote up
/**
 * Create and return an {@link SelectIterator} for the class using a prepared statement.
 */
public SelectIterator<T, ID> buildIterator(BaseDaoImpl<T, ID> classDao, ConnectionSource connectionSource,
		PreparedStmt<T> preparedStmt, ObjectCache objectCache, int resultFlags) throws SQLException {
	DatabaseConnection connection = connectionSource.getReadOnlyConnection(tableInfo.getTableName());
	CompiledStatement compiledStatement = null;
	try {
		compiledStatement = preparedStmt.compile(connection, StatementType.SELECT, resultFlags);
		SelectIterator<T, ID> iterator = new SelectIterator<T, ID>(tableInfo.getDataClass(), classDao, preparedStmt,
				connectionSource, connection, compiledStatement, preparedStmt.getStatement(), objectCache);
		connection = null;
		compiledStatement = null;
		return iterator;
	} finally {
		IOUtils.closeThrowSqlException(compiledStatement, "compiled statement");
		if (connection != null) {
			connectionSource.releaseConnection(connection);
		}
	}
}
 
Example #7
Source File: TableUtils.java    From ormlite-core with ISC License 5 votes vote down vote up
private static <T, ID> int doCreateTable(Dao<T, ID> dao, boolean ifNotExists) throws SQLException {
	ConnectionSource connectionSource = dao.getConnectionSource();
	DatabaseType databaseType = connectionSource.getDatabaseType();
	if (dao instanceof BaseDaoImpl<?, ?>) {
		return doCreateTable(connectionSource, ((BaseDaoImpl<?, ?>) dao).getTableInfo(), ifNotExists);
	} else {
		TableInfo<T, ID> tableInfo = new TableInfo<T, ID>(databaseType, dao.getDataClass());
		return doCreateTable(connectionSource, tableInfo, ifNotExists);
	}
}
 
Example #8
Source File: BaseCoreTest.java    From ormlite-core with ISC License 5 votes vote down vote up
protected <T, ID> Dao<T, ID> createDao(DatabaseTableConfig<T> tableConfig, boolean createTable)
		throws SQLException {
	if (connectionSource == null) {
		throw new SQLException("Connection source is null");
	}
	@SuppressWarnings("unchecked")
	BaseDaoImpl<T, ID> dao = (BaseDaoImpl<T, ID>) DaoManager.createDao(connectionSource, tableConfig);
	return configDao(dao, createTable);
}
 
Example #9
Source File: BaseCoreTest.java    From ormlite-core with ISC License 5 votes vote down vote up
protected <T, ID> Dao<T, ID> createDao(Class<T> clazz, boolean createTable) throws SQLException {
	if (connectionSource == null) {
		throw new SQLException("Connection source is null");
	}
	@SuppressWarnings("unchecked")
	BaseDaoImpl<T, ID> dao = (BaseDaoImpl<T, ID>) DaoManager.createDao(connectionSource, clazz);
	return configDao(dao, createTable);
}
 
Example #10
Source File: TableInfoTest.java    From ormlite-core with ISC License 5 votes vote down vote up
@Test
public void testHasColumnName() throws Exception {
	Dao<Foo, String> dao = createDao(Foo.class, true);
	TableInfo<Foo, String> tableInfo = ((BaseDaoImpl<Foo, String>) dao).getTableInfo();
	assertTrue(tableInfo.hasColumnName(COLUMN_NAME));
	assertFalse(tableInfo.hasColumnName("not this name"));
}
 
Example #11
Source File: WhereTest.java    From ormlite-core with ISC License 5 votes vote down vote up
@Test(expected = SQLException.class)
public void testInSubQueryToManySubColumns() throws Exception {
	TableInfo<ForeignFoo, Integer> tableInfo = new TableInfo<ForeignFoo, Integer>(databaseType, ForeignFoo.class);
	Where<ForeignFoo, Integer> where = new Where<ForeignFoo, Integer>(tableInfo, null, databaseType);
	BaseDaoImpl<ForeignFoo, Integer> foreignDao =
			new BaseDaoImpl<ForeignFoo, Integer>(connectionSource, ForeignFoo.class) {
			};
	QueryBuilder<ForeignFoo, Integer> qb = foreignDao.queryBuilder();
	qb.selectColumns(ID_COLUMN_NAME, FOREIGN_COLUMN_NAME);
	where.in(ID_COLUMN_NAME, qb);
}
 
Example #12
Source File: InSubQueryTest.java    From ormlite-core with ISC License 5 votes vote down vote up
@Test(expected = SQLException.class)
public void testResultColumnNoMatchWhere() throws Exception {
	BaseDaoImpl<ForeignFoo, Integer> foreignDao =
			new BaseDaoImpl<ForeignFoo, Integer>(connectionSource, ForeignFoo.class) {
			};
	QueryBuilder<ForeignFoo, Integer> qbInner = foreignDao.queryBuilder();
	qbInner.selectColumns(STRING_COLUMN_NAME);
	QueryBuilder<ForeignFoo, Integer> qbOuter = foreignDao.queryBuilder();
	Where<ForeignFoo, Integer> where = qbOuter.where();
	where.in(ID_COLUMN_NAME, qbInner);
	where.prepare();
}
 
Example #13
Source File: InSubQueryTest.java    From ormlite-core with ISC License 5 votes vote down vote up
@Test(expected = SQLException.class)
public void testTwoResultsInSubQuery() throws Exception {
	BaseDaoImpl<ForeignFoo, Integer> foreignDao =
			new BaseDaoImpl<ForeignFoo, Integer>(connectionSource, ForeignFoo.class) {
			};
	QueryBuilder<ForeignFoo, Integer> qbInner = foreignDao.queryBuilder();
	qbInner.selectColumns(ID_COLUMN_NAME);
	QueryBuilder<ForeignFoo, Integer> qbOuter = foreignDao.queryBuilder();
	qbInner.selectColumns(FOREIGN_COLUMN_NAME);

	Where<ForeignFoo, Integer> where = qbOuter.where();
	where.in(ID_COLUMN_NAME, qbInner);
	where.prepare();
}
 
Example #14
Source File: GeoPackageCoreImpl.java    From geopackage-core-java with MIT License 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public <T, S extends BaseDaoImpl<T, ?>> S createDao(Class<T> type) {
	S dao;
	try {
		dao = DaoManager.createDao(database.getConnectionSource(), type);
	} catch (SQLException e) {
		throw new GeoPackageException(
				"Failed to create " + type.getSimpleName() + " dao", e);
	}
	return dao;
}
 
Example #15
Source File: TableUtils.java    From ormlite-core with ISC License 5 votes vote down vote up
/**
 * Issue the database statements to drop the table associated with a dao.
 * 
 * @param dao
 *            Associated dao.
 * @return The number of statements executed to do so.
 */
public static <T, ID> int dropTable(Dao<T, ID> dao, boolean ignoreErrors) throws SQLException {
	ConnectionSource connectionSource = dao.getConnectionSource();
	Class<T> dataClass = dao.getDataClass();
	DatabaseType databaseType = connectionSource.getDatabaseType();
	if (dao instanceof BaseDaoImpl<?, ?>) {
		return doDropTable(databaseType, connectionSource, ((BaseDaoImpl<?, ?>) dao).getTableInfo(), ignoreErrors);
	} else {
		TableInfo<T, ID> tableInfo = new TableInfo<T, ID>(databaseType, dataClass);
		return doDropTable(databaseType, connectionSource, tableInfo, ignoreErrors);
	}
}
 
Example #16
Source File: TableUtils.java    From ormlite-core with ISC License 5 votes vote down vote up
/**
 * Return an list of SQL statements that need to be run to create a table. To do the work of creating, you should
 * call {@link #createTable}.
 * 
 * @param connectionSource
 *            Our connect source which is used to get the database type, not to apply the creates.
 * @param tableConfig
 *            Hand or spring wired table configuration. If null then the class must have {@link DatabaseField}
 *            annotations.
 * @return The list of table create statements.
 */
public static <T, ID> List<String> getCreateTableStatements(ConnectionSource connectionSource,
		DatabaseTableConfig<T> tableConfig) throws SQLException {
	Dao<T, ID> dao = DaoManager.createDao(connectionSource, tableConfig);
	DatabaseType databaseType = connectionSource.getDatabaseType();
	if (dao instanceof BaseDaoImpl<?, ?>) {
		return addCreateTableStatements(databaseType, ((BaseDaoImpl<?, ?>) dao).getTableInfo(), false, false);
	} else {
		tableConfig.extractFieldTypes(databaseType);
		TableInfo<T, ID> tableInfo = new TableInfo<T, ID>(databaseType, tableConfig);
		return addCreateTableStatements(databaseType, tableInfo, false, false);
	}
}
 
Example #17
Source File: BaseJdbcTest.java    From ormlite-jdbc with ISC License 5 votes vote down vote up
private <T, ID> Dao<T, ID> configDao(BaseDaoImpl<T, ID> dao, boolean createTable) throws Exception {
	if (connectionSource == null) {
		throw new SQLException(DATASOURCE_ERROR);
	}
	dao.setConnectionSource(connectionSource);
	if (createTable) {
		DatabaseTableConfig<T> tableConfig = dao.getTableConfig();
		if (tableConfig == null) {
			tableConfig = DatabaseTableConfig.fromClass(databaseType, dao.getDataClass());
		}
		createTable(tableConfig, true);
	}
	dao.initialize();
	return dao;
}
 
Example #18
Source File: BaseJdbcTest.java    From ormlite-jdbc with ISC License 5 votes vote down vote up
protected <T, ID> Dao<T, ID> createDao(DatabaseTableConfig<T> tableConfig, boolean createTable) throws Exception {
	if (connectionSource == null) {
		throw new SQLException(DATASOURCE_ERROR);
	}
	@SuppressWarnings("unchecked")
	BaseDaoImpl<T, ID> dao = (BaseDaoImpl<T, ID>) DaoManager.createDao(connectionSource, tableConfig);
	return configDao(dao, createTable);
}
 
Example #19
Source File: BaseJdbcTest.java    From ormlite-jdbc with ISC License 5 votes vote down vote up
protected <T, ID> Dao<T, ID> createDao(Class<T> clazz, boolean createTable) throws Exception {
	if (connectionSource == null) {
		throw new SQLException(DATASOURCE_ERROR);
	}
	@SuppressWarnings("unchecked")
	BaseDaoImpl<T, ID> dao = (BaseDaoImpl<T, ID>) DaoManager.createDao(connectionSource, clazz);
	return configDao(dao, createTable);
}
 
Example #20
Source File: HsqldbDatabaseTypeTest.java    From ormlite-jdbc with ISC License 5 votes vote down vote up
@Override
@Test
public void testLimitFormat() throws Exception {
	connectionSource.setDatabaseType(databaseType);
	BaseDaoImpl<StringId, String> dao = new BaseDaoImpl<StringId, String>(connectionSource, StringId.class) {
	};
	dao.initialize();
	QueryBuilder<StringId, String> qb = dao.queryBuilder();
	long limit = 1232;
	qb.limit(limit);
	String query = qb.prepareStatementString();
	assertTrue(query + " should start with stuff", query.startsWith("SELECT LIMIT 0 " + limit + " "));
}
 
Example #21
Source File: TableCreator.java    From ormlite-jdbc with ISC License 5 votes vote down vote up
/**
 * If you are using the Spring type wiring, this should be called after all of the set methods.
 */
public void initialize() throws SQLException {
	if (!Boolean.parseBoolean(System.getProperty(AUTO_CREATE_TABLES))) {
		return;
	}

	if (configuredDaos == null) {
		throw new SQLException("configuredDaos was not set in " + getClass().getSimpleName());
	}

	// find all of the daos and create the tables
	for (Dao<?, ?> dao : configuredDaos) {
		Class<?> clazz = dao.getDataClass();
		try {
			DatabaseTableConfig<?> tableConfig = null;
			if (dao instanceof BaseDaoImpl) {
				tableConfig = ((BaseDaoImpl<?, ?>) dao).getTableConfig();
			}
			if (tableConfig == null) {
				tableConfig = DatabaseTableConfig.fromClass(connectionSource.getDatabaseType(), clazz);
			}
			TableUtils.createTable(connectionSource, tableConfig);
			createdClasses.add(tableConfig);
		} catch (Exception e) {
			// we don't stop because the table might already exist
			System.err.println("Was unable to auto-create table for " + clazz);
			e.printStackTrace();
		}
	}
}
 
Example #22
Source File: ApsTableUtils.java    From entando-core with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static <T, ID> int createTable(ConnectionSource connectionSource, Class<T> dataClass, boolean ifNotExists)
		throws SQLException {
	Dao<T, ID> dao = DaoManager.createDao(connectionSource, dataClass);
	if (dao instanceof BaseDaoImpl<?, ?>) {
		return doCreateTable(connectionSource, ((BaseDaoImpl<?, ?>) dao).getTableInfo(), ifNotExists);
	} else {
		TableInfo<T, ID> tableInfo = new TableInfo<T, ID>(connectionSource, null, dataClass);
		return doCreateTable(connectionSource, tableInfo, ifNotExists);
	}
}
 
Example #23
Source File: GeoPackageCoreImpl.java    From geopackage-core-java with MIT License 5 votes vote down vote up
/**
 * Verify table or view exists
 *
 * @param dao
 */
private void verifyTableExists(BaseDaoImpl<?, ?> dao) {
	try {
		if (!dao.isTableExists()) {
			throw new GeoPackageException(
					"Table or view does not exist for: "
							+ dao.getDataClass().getSimpleName());
		}
	} catch (SQLException e) {
		throw new GeoPackageException(
				"Failed to detect if table or view exists for dao: "
						+ dao.getDataClass().getSimpleName(),
				e);
	}
}
 
Example #24
Source File: TableInfo.java    From ormlite-core with ISC License 4 votes vote down vote up
/**
 * @deprecated Use {@link #TableInfo(DatabaseType, Class)}
 */
@Deprecated
public TableInfo(ConnectionSource connectionSource, BaseDaoImpl<T, ID> baseDaoImpl, Class<T> dataClass)
		throws SQLException {
	this(connectionSource.getDatabaseType(), dataClass);
}
 
Example #25
Source File: TableInfo.java    From ormlite-core with ISC License 4 votes vote down vote up
/**
 * @deprecated Use {@link #TableInfo(DatabaseType, DatabaseTableConfig)}
 */
@Deprecated
public TableInfo(DatabaseType databaseType, BaseDaoImpl<T, ID> baseDaoImpl, DatabaseTableConfig<T> tableConfig)
		throws SQLException {
	this(databaseType, tableConfig);
}
 
Example #26
Source File: StatementExecutor.java    From ormlite-core with ISC License 4 votes vote down vote up
/**
 * Create and return a SelectIterator for the class using the default mapped query for all statement.
 */
public SelectIterator<T, ID> buildIterator(BaseDaoImpl<T, ID> classDao, ConnectionSource connectionSource,
		int resultFlags, ObjectCache objectCache) throws SQLException {
	prepareQueryForAll();
	return buildIterator(classDao, connectionSource, preparedQueryForAll, objectCache, resultFlags);
}
 
Example #27
Source File: OpenHelperManager.java    From ormlite-android with ISC License 4 votes vote down vote up
private static <T extends OrmLiteSqliteOpenHelper> T loadHelper(Context context, Class<T> openHelperClass) {
	if (helper == null) {
		if (wasClosed) {
			// this can happen if you are calling get/release and then get again
			logger.info("helper was already closed and is being re-opened");
		}
		if (context == null) {
			throw new IllegalArgumentException("context argument is null");
		}
		Context appContext = context.getApplicationContext();
		helper = constructHelper(appContext, openHelperClass);
		logger.trace("zero instances, created helper {}", helper);
		/*
		 * Filipe Leandro and I worked on this bug for like 10 hours straight. It's a doosey.
		 * 
		 * Each ForeignCollection has internal DAO objects that are holding a ConnectionSource. Each Android
		 * ConnectionSource is tied to a particular database connection. What Filipe was seeing was that when all of
		 * his views we closed (onDestroy), but his application WAS NOT FULLY KILLED, the first View.onCreate()
		 * method would open a new connection to the database. Fine. But because he application was still in memory,
		 * the static BaseDaoImpl default cache had not been cleared and was containing cached objects with
		 * ForeignCollections. The ForeignCollections still had references to the DAOs that had been opened with old
		 * ConnectionSource objects and therefore the old database connection. Using those cached collections would
		 * cause exceptions saying that you were trying to work with a database that had already been close.
		 * 
		 * Now, whenever we create a new helper object, we must make sure that the internal object caches have been
		 * fully cleared. This is a good lesson for anyone that is holding objects around after they have closed
		 * connections to the database or re-created the DAOs on a different connection somehow.
		 */
		BaseDaoImpl.clearAllInternalObjectCaches();
		/*
		 * Might as well do this also since if the helper changes then the ConnectionSource will change so no one is
		 * going to have a cache hit on the old DAOs anyway. All they are doing is holding memory.
		 * 
		 * NOTE: we don't want to clear the config map.
		 */
		DaoManager.clearDaoCache();
		instanceCount = 0;
	}

	instanceCount++;
	logger.trace("returning helper {}, instance count = {} ", helper, instanceCount);
	@SuppressWarnings("unchecked")
	T castHelper = (T) helper;
	return castHelper;
}
 
Example #28
Source File: WhereTest.java    From ormlite-core with ISC License 4 votes vote down vote up
@Test(expected = SQLException.class)
public void testIdEqObjectIdNoId() throws Exception {
	new Where<FooNoId, Integer>(new TableInfo<FooNoId, Integer>(databaseType, FooNoId.class), null, databaseType)
			.idEq(new BaseDaoImpl<FooNoId, Integer>(connectionSource, FooNoId.class) {
			}, new FooNoId());
}
 
Example #29
Source File: TableUtils.java    From ormlite-core with ISC License 3 votes vote down vote up
/**
 * Issue the database statements to drop the table associated with a table configuration.
 * 
 * <p>
 * <b>WARNING:</b> This is [obviously] very destructive and is unrecoverable.
 * </p>
 * 
 * @param connectionSource
 *            Associated connection source.
 * @param tableConfig
 *            Hand or spring wired table configuration. If null then the class must have {@link DatabaseField}
 *            annotations.
 * @param ignoreErrors
 *            If set to true then try each statement regardless of {@link SQLException} thrown previously.
 * @return The number of statements executed to do so.
 */
public static <T, ID> int dropTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig,
		boolean ignoreErrors) throws SQLException {
	DatabaseType databaseType = connectionSource.getDatabaseType();
	Dao<T, ID> dao = DaoManager.createDao(connectionSource, tableConfig);
	if (dao instanceof BaseDaoImpl<?, ?>) {
		return doDropTable(databaseType, connectionSource, ((BaseDaoImpl<?, ?>) dao).getTableInfo(), ignoreErrors);
	} else {
		tableConfig.extractFieldTypes(databaseType);
		TableInfo<T, ID> tableInfo = new TableInfo<T, ID>(databaseType, tableConfig);
		return doDropTable(databaseType, connectionSource, tableInfo, ignoreErrors);
	}
}
 
Example #30
Source File: GeoPackageCore.java    From geopackage-core-java with MIT License 2 votes vote down vote up
/**
 * Create a dao
 *
 * @param type
 *            dao class type
 * @param <T>
 *            class type
 * @param <S>
 *            dao type
 * @return base dao implementation
 * @since 1.1.0
 */
public <T, S extends BaseDaoImpl<T, ?>> S createDao(Class<T> type);