本文整理汇总了Java中com.j256.ormlite.misc.BaseDaoEnabled类的典型用法代码示例。如果您正苦于以下问题:Java BaseDaoEnabled类的具体用法?Java BaseDaoEnabled怎么用?Java BaseDaoEnabled使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseDaoEnabled类属于com.j256.ormlite.misc包,在下文中一共展示了BaseDaoEnabled类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import com.j256.ormlite.misc.BaseDaoEnabled; //导入依赖的package包/类
public int create(T paramT)
{
checkForInitialized();
if (paramT == null)
return 0;
if ((paramT instanceof BaseDaoEnabled))
((BaseDaoEnabled)paramT).setDao(this);
DatabaseConnection localDatabaseConnection = this.connectionSource.getReadWriteConnection();
try
{
int i = this.statementExecutor.create(localDatabaseConnection, paramT, this.objectCache);
return i;
}
finally
{
this.connectionSource.releaseConnection(localDatabaseConnection);
}
}
示例2: refresh
import com.j256.ormlite.misc.BaseDaoEnabled; //导入依赖的package包/类
public int refresh(T paramT)
{
checkForInitialized();
if (paramT == null)
return 0;
if ((paramT instanceof BaseDaoEnabled))
((BaseDaoEnabled)paramT).setDao(this);
DatabaseConnection localDatabaseConnection = this.connectionSource.getReadOnlyConnection();
try
{
int i = this.statementExecutor.refresh(localDatabaseConnection, paramT, this.objectCache);
return i;
}
finally
{
this.connectionSource.releaseConnection(localDatabaseConnection);
}
}
示例3: create
import com.j256.ormlite.misc.BaseDaoEnabled; //导入依赖的package包/类
@Override
public int create(T data) throws SQLException {
checkForInitialized();
// ignore creating a null object
if (data == null) {
return 0;
}
if (data instanceof BaseDaoEnabled) {
@SuppressWarnings("unchecked")
BaseDaoEnabled<T, ID> daoEnabled = (BaseDaoEnabled<T, ID>) data;
daoEnabled.setDao(this);
}
DatabaseConnection connection = connectionSource.getReadWriteConnection(tableInfo.getTableName());
try {
return statementExecutor.create(connection, data, objectCache);
} finally {
connectionSource.releaseConnection(connection);
}
}
示例4: update
import com.j256.ormlite.misc.BaseDaoEnabled; //导入依赖的package包/类
@Override
public int update(T data) throws SQLException {
checkForInitialized();
// ignore updating a null object
if (data == null) {
return 0;
}
if (data instanceof BaseDaoEnabled) {
@SuppressWarnings("unchecked")
BaseDaoEnabled<T, ID> daoEnabled = (BaseDaoEnabled<T, ID>) data;
daoEnabled.setDao(this);
}
DatabaseConnection connection = connectionSource.getReadWriteConnection(tableInfo.getTableName());
try {
return statementExecutor.update(connection, data, objectCache);
} finally {
connectionSource.releaseConnection(connection);
}
}
示例5: refresh
import com.j256.ormlite.misc.BaseDaoEnabled; //导入依赖的package包/类
@Override
public int refresh(T data) throws SQLException {
checkForInitialized();
// ignore refreshing a null object
if (data == null) {
return 0;
}
if (data instanceof BaseDaoEnabled) {
@SuppressWarnings("unchecked")
BaseDaoEnabled<T, ID> daoEnabled = (BaseDaoEnabled<T, ID>) data;
daoEnabled.setDao(this);
}
DatabaseConnection connection = connectionSource.getReadOnlyConnection(tableInfo.getTableName());
try {
return statementExecutor.refresh(connection, data, objectCache);
} finally {
connectionSource.releaseConnection(connection);
}
}
示例6: wireNewInstance
import com.j256.ormlite.misc.BaseDaoEnabled; //导入依赖的package包/类
private static <T, ID> void wireNewInstance(BaseDaoImpl<T, ID> baseDaoImpl, T instance) {
if (instance instanceof BaseDaoEnabled) {
@SuppressWarnings("unchecked")
BaseDaoEnabled<T, ID> daoEnabled = (BaseDaoEnabled<T, ID>) instance;
daoEnabled.setDao(baseDaoImpl);
}
}
示例7: wireNewInstance
import com.j256.ormlite.misc.BaseDaoEnabled; //导入依赖的package包/类
private static <T, ID> void wireNewInstance(BaseDaoImpl<T, ID> paramBaseDaoImpl, T paramT)
{
if ((paramT instanceof BaseDaoEnabled))
((BaseDaoEnabled)paramT).setDao(paramBaseDaoImpl);
}