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


Java Configuration类代码示例

本文整理汇总了Java中com.querydsl.sql.Configuration的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: removeAllUsersFromScheme

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private void removeAllUsersFromScheme(final long schemeId, final Connection connection,
    final Configuration configuration) {

  final int batchSize = 100;
  QUserWorkScheme qUserWorkScheme = QUserWorkScheme.userWorkScheme;

  SQLQuery<Long> sqlQuery = new SQLQuery<Long>(connection, configuration)
      .select(qUserWorkScheme.dateRangeId).from(qUserWorkScheme)
      .where(qUserWorkScheme.workSchemeId.eq(schemeId)).limit(batchSize);

  List<Long> dateRangeIds = sqlQuery.fetch();
  DateRangeUtil dateRangeUtil = new DateRangeUtil(connection, configuration);

  while (!dateRangeIds.isEmpty()) {
    new SQLDeleteClause(connection, configuration, qUserWorkScheme)
        .where(qUserWorkScheme.dateRangeId.in(dateRangeIds)).execute();

    dateRangeUtil.removeDateRange(dateRangeIds.toArray(new Long[dateRangeIds.size()]));

    dateRangeIds = sqlQuery.fetch();
  }

}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:24,代码来源:WorkSchemesServlet.java

示例2: processDateRange

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private void processDateRange(final Date startDate, final Date endDateExcluded,
    final Set<Date> insertedDates, final List<Date> dateBatch, final int batchSize,
    final Connection connection, final Configuration configuration) {

  for (Date dateCursor = startDate; dateCursor.before(endDateExcluded); dateCursor =
      DateUtil.addDays(dateCursor, 1)) {

    if (!insertedDates.contains(dateCursor)) {
      insertedDates.add(dateCursor);
      dateBatch.add(dateCursor);
      if (dateBatch.size() == batchSize) {
        flushDateBatch(dateBatch, connection, configuration);
      }
    }
  }
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:17,代码来源:JiraHRAdminPluginActivator.java

示例3: synchronizeDateSequenceIfNecessary

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private Object synchronizeDateSequenceIfNecessary(final Connection connection,
    final Configuration configuration) {

  QDateSequence qDateSequence = QDateSequence.dateSequence;
  long dateSequenceCount = new SQLQuery<>(connection, configuration)
      .select(Expressions.ONE.count()).from(qDateSequence).fetchOne();

  if (dateSequenceCount == 0) {
    QDateRange qDateRange = QDateRange.dateRange;
    long dateRangeCount = new SQLQuery<>(connection, configuration)
        .select(Expressions.ONE.count()).from(qDateRange).fetchOne();
    if (dateRangeCount != 0) {
      fillDateSequenceFromDateRanges(connection, configuration, dateRangeCount);
    }
  }
  return null;
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:18,代码来源:JiraHRAdminPluginActivator.java

示例4: removeAllUsersFromScheme

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private void removeAllUsersFromScheme(final long schemeId, final Connection connection,
    final Configuration configuration) {

  final int batchSize = 100;
  QUserHolidayScheme qUserHolidayScheme = QUserHolidayScheme.userHolidayScheme;

  SQLQuery<Long> sqlQuery = new SQLQuery<Long>(connection, configuration)
      .select(qUserHolidayScheme.dateRangeId).from(qUserHolidayScheme)
      .where(qUserHolidayScheme.holidaySchemeId.eq(schemeId)).limit(batchSize);

  List<Long> dateRangeIds = sqlQuery.fetch();

  while (!dateRangeIds.isEmpty()) {
    new SQLDeleteClause(connection, configuration, qUserHolidayScheme)
        .where(qUserHolidayScheme.dateRangeId.in(dateRangeIds)).execute();

    new DateRangeUtil(connection, configuration)
        .removeDateRange(dateRangeIds.toArray(new Long[dateRangeIds.size()]));

    dateRangeIds = sqlQuery.fetch();
  }

}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:24,代码来源:HolidaySchemesServlet.java

示例5: LibraryDatabase

import com.querydsl.sql.Configuration; //导入依赖的package包/类
/**
 * Loads the database used for storing locations of mp3 files contained in the library for later playback
 * If needed creates a new database based on the available tags of the mp3agic library
 *
 * @param databaseLocation Location of the sqlite database
 * @throws SQLException should theoretically not get thrown, if thrown something in generating the tables through SQL went wrong
 * @throws IOException  gets thrown in case the needed folder structure for the database can't be created
 */
public LibraryDatabase(File databaseLocation) throws SQLException, IOException {
    if(!databaseLocation.isAbsolute()) databaseLocation = databaseLocation.getAbsoluteFile();
    if (!databaseLocation.exists()) {
        if (!databaseLocation.getParentFile().mkdirs() && !databaseLocation.getParentFile().exists())
            throw new IOException("Unable to create database directory");

        Connection conn = DriverManager.getConnection("jdbc:sqlite:" + databaseLocation.getAbsolutePath());
        Statement stmt = conn.createStatement();

        stmt.executeUpdate("CREATE TABLE IF NOT EXISTS LibraryFolder (path TEXT PRIMARY KEY)");

        StringBuilder builderFileTable = new StringBuilder();
        builderFileTable.append("CREATE TABLE IF NOT EXISTS LibraryFile (file_id INTEGER PRIMARY KEY AUTOINCREMENT, path TEXT UNIQUE");
        for (ID3Helper.ID3Tag id3Tag : ID3Helper.ID3Tag.values()) {
            builderFileTable
                    .append(", ")
                    .append(id3Tag.toString().toLowerCase())
                    .append(" TEXT");
        }
        builderFileTable.append(")");
        stmt.executeUpdate(builderFileTable.toString());
        conn.close();
    }

    /**/

    SQLiteTemplates sqLiteTemplate = new SQLiteTemplates();
    Configuration config = new Configuration(sqLiteTemplate);

    SQLiteDataSource dataSource = new SQLiteDataSource();
    dataSource.setUrl("jdbc:sqlite:" + databaseLocation.getAbsolutePath());

    queryFactory = new SQLQueryFactory(config, dataSource);

    reloadFiles();
    reloadFolders();
}
 
开发者ID:MolaynoxX,项目名称:amperfi,代码行数:46,代码来源:LibraryDatabase.java

示例6: getDateRangeId

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private Long getDateRangeId(final Long userHolidayAmountId, final Connection connection,
    final Configuration configuration) {

  QDateRange qDateRange = QDateRange.dateRange;
  QUserHolidayAmount qUserHolidayAmount = QUserHolidayAmount.userHolidayAmount;

  Long dateRangeId = new SQLQuery<Long>(connection, configuration)
      .select(qDateRange.dateRangeId)
      .from(qUserHolidayAmount)
      .innerJoin(qUserHolidayAmount.fk.dateRangeFK, qDateRange)
      .where(qUserHolidayAmount.userHolidayAmountId.eq(userHolidayAmountId))
      .fetchOne();

  return dateRangeId;
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:16,代码来源:UserHolidayAmountServlet.java

示例7: removeAllExactWorkFromScheme

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private void removeAllExactWorkFromScheme(final long schemeId, final Connection connection,
    final Configuration configuration) {

  QExactWork qExactWork = QExactWork.exactWork;
  new SQLDeleteClause(connection, configuration, qExactWork)
      .where(qExactWork.workSchemeId.eq(schemeId)).execute();
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:8,代码来源:WorkSchemesServlet.java

示例8: removeAllRegularWorkTimesFromScheme

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private void removeAllRegularWorkTimesFromScheme(final long schemeId, final Connection connection,
    final Configuration configuration) {

  QWeekdayWork qWeekdayWork = QWeekdayWork.weekdayWork;
  new SQLDeleteClause(connection, configuration, qWeekdayWork)
      .where(qWeekdayWork.workSchemeId.eq(schemeId)).execute();
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:8,代码来源:WorkSchemesServlet.java

示例9: flushDateBatch

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private void flushDateBatch(final List<Date> dateBatch, final Connection connection,
    final Configuration configuration) {

  QDateSequence dateSequence = QDateSequence.dateSequence;
  SQLInsertClause insertClause = new SQLInsertClause(connection, configuration, dateSequence);
  for (Date date : dateBatch) {
    insertClause.set(dateSequence.date, date).addBatch();
  }
  insertClause.execute();
  dateBatch.clear();

}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:13,代码来源:JiraHRAdminPluginActivator.java

示例10: TransactionInstancesHolder

import com.querydsl.sql.Configuration; //导入依赖的package包/类
public TransactionInstancesHolder(DataSource realDataSource) {
	try {
		Connection realConnection = realDataSource.getConnection();
		mockedConnection = new ConnectionMocked(realConnection);
		mockedDataSource = new DataSourceMocked(mockedConnection);

		transactionManager = new TransactionManagerQuerydsl(
			mockedDataSource,
			new Configuration(H2Templates.DEFAULT)
		);
	} catch (SQLException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:Coreoz,项目名称:Plume,代码行数:15,代码来源:TransactionInstancesHolder.java

示例11: HibernateToQuerydslBridge

import com.querydsl.sql.Configuration; //导入依赖的package包/类
@Inject
public HibernateToQuerydslBridge(Config config,
		TransactionManagerHibernate transactionManagerHibernate) {
	String hibernateDialect = config.getObject("db").get("hibernate.dialect").toString();

	this.transactionManagerQuerydsl = new TransactionManagerQuerydsl(
		transactionManagerHibernate.dataSource(),
		new Configuration(toSQLTemplates(hibernateDialect))
	);
}
 
开发者ID:Coreoz,项目名称:Plume,代码行数:11,代码来源:HibernateToQuerydslBridge.java

示例12: registerTypes

import com.querydsl.sql.Configuration; //导入依赖的package包/类
public static void registerTypes(String tablePrefix, Configuration configuration) {
    configuration.register(tablePrefix + "VERSION", "TYPE", new EnumByNameType<>(VersionType.class));
    configuration.register(tablePrefix + "VERSION", "REVISION", REVISION_TYPE);
    configuration.register(tablePrefix + "VERSION", "STATUS", VERSION_STATUS_TYPE);

    configuration.register(tablePrefix + "VERSION_PARENT", "REVISION", REVISION_TYPE);
    configuration.register(tablePrefix + "VERSION_PARENT", "PARENT_REVISION", REVISION_TYPE);
    configuration.register(tablePrefix + "VERSION_PARENT", "STATUS", VERSION_STATUS_TYPE);

    configuration.register(tablePrefix + "VERSION_PROPERTY", "REVISION", REVISION_TYPE);
    configuration.register(tablePrefix + "VERSION_PROPERTY", "STATUS", VERSION_STATUS_TYPE);
}
 
开发者ID:ssaarela,项目名称:javersion,代码行数:13,代码来源:AbstractVersionStoreJdbc.java

示例13: removeAllPublicHolidays

import com.querydsl.sql.Configuration; //导入依赖的package包/类
private void removeAllPublicHolidays(final long schemeId, final Connection connection,
    final Configuration configuration) {
  QPublicHoliday qPublicHoliday = QPublicHoliday.publicHoliday;
  new SQLDeleteClause(connection, configuration, qPublicHoliday)
      .where(qPublicHoliday.holidaySchemeId.eq(schemeId)).execute();
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:7,代码来源:HolidaySchemesServlet.java

示例14: DateRangeUtil

import com.querydsl.sql.Configuration; //导入依赖的package包/类
public DateRangeUtil(final Connection connection, final Configuration configuration) {
  this.connection = connection;
  this.configuration = configuration;
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:5,代码来源:DateRangeUtil.java

示例15: TransactionManagerQuerydsl

import com.querydsl.sql.Configuration; //导入依赖的package包/类
public TransactionManagerQuerydsl(Config config, String prefix) {
	super(config, prefix);

	String dialect = config.getString(prefix + ".dialect");
	this.querydslConfiguration = new Configuration(QuerydslTemplates.valueOf(dialect).sqlTemplates());
}
 
开发者ID:Coreoz,项目名称:Plume,代码行数:7,代码来源:TransactionManagerQuerydsl.java


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