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


Java BaseDaoEnabled类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:19,代码来源:BaseDaoImpl.java

示例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);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:19,代码来源:BaseDaoImpl.java

示例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);
	}
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:20,代码来源:BaseDaoImpl.java

示例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);
	}
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:20,代码来源:BaseDaoImpl.java

示例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);
	}
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:20,代码来源:BaseDaoImpl.java

示例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);
	}
}
 
开发者ID:j256,项目名称:ormlite-core,代码行数:8,代码来源:TableInfo.java

示例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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:6,代码来源:TableInfo.java


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