请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SchemaInitializer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  install(new JpaPersistModule("main"));
  H2DBTestServer server = H2DBTestServer.startDefault();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(DBInitializer.class).asEagerSingleton();
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));

  bind(new TypeLiteral<TckRepository<FreeResourcesLimitImpl>>() {})
      .toInstance(new JpaTckRepository<>(FreeResourcesLimitImpl.class));
  bind(new TypeLiteral<TckRepository<AccountImpl>>() {})
      .toInstance(new JpaTckRepository<>(AccountImpl.class));

  bind(FreeResourcesLimitDao.class).to(JpaFreeResourcesLimitDao.class);
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:ResourceTckModule.java


示例2: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  install(new JpaPersistModule("main"));
  H2DBTestServer server = H2DBTestServer.startDefault();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(DBInitializer.class).asEagerSingleton();
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));

  bind(new TypeLiteral<AbstractPermissionsDomain<MemberImpl>>() {}).to(OrganizationDomain.class);

  bind(new TypeLiteral<TckRepository<OrganizationImpl>>() {})
      .to(JpaOrganizationImplTckRepository.class);
  bind(new TypeLiteral<TckRepository<UserImpl>>() {})
      .toInstance(new JpaTckRepository<>(UserImpl.class));
  bind(new TypeLiteral<TckRepository<MemberImpl>>() {})
      .toInstance(new JpaTckRepository<>(MemberImpl.class));
  bind(new TypeLiteral<TckRepository<OrganizationDistributedResourcesImpl>>() {})
      .toInstance(new JpaTckRepository<>(OrganizationDistributedResourcesImpl.class));

  bind(OrganizationDao.class).to(JpaOrganizationDao.class);
  bind(MemberDao.class).to(JpaMemberDao.class);

  bind(OrganizationDistributedResourcesDao.class)
      .to(JpaOrganizationDistributedResourcesDao.class);
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:OrganizationJpaTckModule.java


示例3: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClass(AccountImpl.class)
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));

  bind(new TypeLiteral<TckRepository<AccountImpl>>() {})
      .toInstance(new JpaTckRepository<>(AccountImpl.class));

  bind(AccountDao.class).to(JpaAccountDao.class);
}
 
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:AccountJpaTckModule.java


示例4: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(SshPairImpl.class, UserImpl.class, AccountImpl.class)
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));

  bind(SshDao.class).to(JpaSshDao.class);
  bind(new TypeLiteral<TckRepository<SshPairImpl>>() {})
      .toInstance(new JpaTckRepository<>(SshPairImpl.class));
  bind(new TypeLiteral<TckRepository<UserImpl>>() {})
      .toInstance(new JpaTckRepository<>(UserImpl.class));
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:SshTckModule.java


示例5: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(InstallerImpl.class, InstallerServerConfigImpl.class)
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server.getDataSource()));

  bind(new TypeLiteral<TckRepository<InstallerImpl>>() {}).to(InstallerJpaTckRepository.class);

  bind(InstallerDao.class).to(JpaInstallerDao.class);
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:JpaTckModule.java


示例6: initializesSchemaWhenDatabaseIsEmpty

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Test
public void initializesSchemaWhenDatabaseIsEmpty() throws Exception {
  createScript("1.0/1__init.sql", "CREATE TABLE test (id INT, text TEXT, PRIMARY KEY (id));");
  createScript(
      "1.0/2__add_data.sql",
      "INSERT INTO test VALUES(1, 'test1');"
          + "INSERT INTO test VALUES(2, 'test2');"
          + "INSERT INTO test VALUES(3, 'test3');");
  createScript("2.0/1__add_more_data.sql", "INSERT INTO test VALUES(4, 'test4');");
  createScript(
      "2.0/postgresql/1__add_more_data.sql", "INSERT INTO test VALUES(4, 'postgresql-data');");

  final SchemaInitializer initializer = FlywayInitializerBuilder.from(dataSource).build();
  initializer.init();

  assertEquals(
      queryEntities(),
      Sets.newHashSet(
          new TestEntity(1, "test1"),
          new TestEntity(2, "test2"),
          new TestEntity(3, "test3"),
          new TestEntity(4, "test4")));

  // second init must do nothing, so there are no conflicts
  initializer.init();
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:FlywaySchemaInitializerTest.java


示例7: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(
              OrganizationImpl.class,
              AccountImpl.class,
              WorkspaceImpl.class,
              WorkspaceConfigImpl.class,
              ProjectConfigImpl.class,
              EnvironmentImpl.class,
              ExtendedMachineImpl.class,
              CommandImpl.class,
              SourceStorageImpl.class,
              ServerConf2Impl.class,
              SnapshotImpl.class,
              InviteImpl.class)
          .addEntityClass(
              "org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl$Attribute")
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(
          new FlywaySchemaInitializer(server.getDataSource(), "che-schema", "codenvy-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));

  bind(new TypeLiteral<TckRepository<InviteImpl>>() {})
      .toInstance(new JpaTckRepository<>(InviteImpl.class));
  bind(new TypeLiteral<TckRepository<OrganizationImpl>>() {})
      .toInstance(new JpaTckRepository<>(OrganizationImpl.class));
  bind(new TypeLiteral<TckRepository<WorkspaceImpl>>() {})
      .toInstance(new JpaTckRepository<>(WorkspaceImpl.class));

  bind(InviteDao.class).to(JpaInviteDao.class);
}
 
开发者ID:codenvy,项目名称:codenvy,代码行数:40,代码来源:InviteJpaTckModule.java


示例8: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  install(new InitModule(PostConstruct.class));
  install(new JpaPersistModule("test"));
  bind(SchemaInitializer.class)
      .toInstance(
          new FlywaySchemaInitializer(inMemoryDefault(), "che-schema", "codenvy-schema"));
  bind(DBInitializer.class).asEagerSingleton();
  bindConstant().annotatedWith(Names.named("codenvy.admin.name")).to(NAME);
  bindConstant().annotatedWith(Names.named("codenvy.admin.initial_password")).to(PASSWORD);
  bindConstant().annotatedWith(Names.named("codenvy.admin.email")).to(EMAIL);
  bind(PermissionsManager.class).toInstance(permissionsManager);
  bind(UserManager.class).toInstance(mock(UserManager.class));
}
 
开发者ID:codenvy,项目名称:codenvy,代码行数:15,代码来源:AdminUserCreatorTest.java


示例9: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  final Map<String, String> properties = new HashMap<>();
  properties.put(TRANSACTION_TYPE, PersistenceUnitTransactionType.RESOURCE_LOCAL.name());

  final String dbUrl = System.getProperty("jdbc.url");
  final String dbUser = System.getProperty("jdbc.user");
  final String dbPassword = System.getProperty("jdbc.password");

  waitConnectionIsEstablished(dbUrl, dbUser, dbPassword);

  properties.put(JDBC_URL, dbUrl);
  properties.put(JDBC_USER, dbUser);
  properties.put(JDBC_PASSWORD, dbPassword);
  properties.put(JDBC_DRIVER, System.getProperty("jdbc.driver"));

  JpaPersistModule main = new JpaPersistModule("main");
  main.properties(properties);
  install(main);
  final PGSimpleDataSource dataSource = new PGSimpleDataSource();
  dataSource.setUser(dbUser);
  dataSource.setPassword(dbPassword);
  dataSource.setUrl(dbUrl);
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(dataSource, "che-schema", "codenvy-schema"));
  bind(DBInitializer.class).asEagerSingleton();
  bind(TckResourcesCleaner.class).to(JpaCleaner.class);

  bind(new TypeLiteral<TckRepository<InviteImpl>>() {})
      .toInstance(new JpaTckRepository<>(InviteImpl.class));
  bind(new TypeLiteral<TckRepository<OrganizationImpl>>() {})
      .toInstance(new JpaTckRepository<>(OrganizationImpl.class));
  bind(new TypeLiteral<TckRepository<WorkspaceImpl>>() {})
      .toInstance(new JpaTckRepository<>(WorkspaceImpl.class));

  bind(InviteDao.class).to(JpaInviteDao.class);
}
 
开发者ID:codenvy,项目名称:codenvy,代码行数:38,代码来源:JpaIntegrationTckModule.java


示例10: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(
              UserImpl.class,
              AccountImpl.class,
              AbstractPermissions.class,
              SystemPermissionsImpl.class)
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));
  // Creates empty multibinder to avoid error during container starting
  Multibinder.newSetBinder(
      binder(), String.class, Names.named(SystemDomain.SYSTEM_DOMAIN_ACTIONS));

  bind(new TypeLiteral<AbstractPermissionsDomain<SystemPermissionsImpl>>() {})
      .to(TestDomain.class);
  bind(new TypeLiteral<PermissionsDao<SystemPermissionsImpl>>() {})
      .to(JpaSystemPermissionsDao.class);

  bind(new TypeLiteral<TckRepository<SystemPermissionsImpl>>() {})
      .toInstance(new JpaTckRepository<>(SystemPermissionsImpl.class));
  bind(new TypeLiteral<TckRepository<UserImpl>>() {})
      .toInstance(new JpaTckRepository<>(UserImpl.class));
}
 
开发者ID:eclipse,项目名称:che,代码行数:33,代码来源:SystemPermissionsTckModule.java


示例11: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(
              UserImpl.class, ProfileImpl.class, PreferenceEntity.class, AccountImpl.class)
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server.getDataSource()));

  bind(new TypeLiteral<TckRepository<UserImpl>>() {}).to(UserJpaTckRepository.class);
  bind(new TypeLiteral<TckRepository<ProfileImpl>>() {})
      .toInstance(new JpaTckRepository<>(ProfileImpl.class));
  bind(new TypeLiteral<TckRepository<Pair<String, Map<String, String>>>>() {})
      .to(PreferenceJpaTckRepository.class);

  bind(UserDao.class).to(JpaUserDao.class);
  bind(ProfileDao.class).to(JpaProfileDao.class);
  bind(PreferenceDao.class).to(JpaPreferenceDao.class);
  // SHA-512 encryptor is faster than PBKDF2 so it is better for testing
  bind(PasswordEncryptor.class).to(SHA512PasswordEncryptor.class).in(Singleton.class);
}
 
开发者ID:eclipse,项目名称:che,代码行数:29,代码来源:JpaTckModule.java


示例12: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(
              AccountImpl.class,
              WorkspaceImpl.class,
              WorkspaceConfigImpl.class,
              ProjectConfigImpl.class,
              EnvironmentImpl.class,
              RecipeImpl.class,
              MachineConfigImpl.class,
              SourceStorageImpl.class,
              ServerConfigImpl.class,
              StackImpl.class,
              CommandImpl.class,
              RecipeImpl.class,
              VolumeImpl.class)
          .addEntityClass(
              "org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl$Attribute")
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));

  bind(new TypeLiteral<TckRepository<AccountImpl>>() {})
      .toInstance(new JpaTckRepository<>(AccountImpl.class));
  bind(new TypeLiteral<TckRepository<WorkspaceImpl>>() {}).toInstance(new WorkspaceRepository());
  bind(new TypeLiteral<TckRepository<StackImpl>>() {}).toInstance(new StackRepository());

  bind(WorkspaceDao.class).to(JpaWorkspaceDao.class);
  bind(StackDao.class).to(JpaStackDao.class);
}
 
开发者ID:eclipse,项目名称:che,代码行数:39,代码来源:WorkspaceTckModule.java


示例13: DBInitializer

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Inject
public DBInitializer(SchemaInitializer schemaInitializer, JpaInitializer jpaInitializer)
    throws SchemaInitializationException {
  // schema must be initialized before any other component that may interact with database
  initProperties = ImmutableMap.copyOf(schemaInitializer.init());

  // jpa initialization goes next
  jpaInitializer.init();
}
 
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:DBInitializer.java


示例14: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(
              AccountImpl.class,
              UserImpl.class,
              WorkspaceImpl.class,
              WorkspaceConfigImpl.class,
              ProjectConfigImpl.class,
              EnvironmentImpl.class,
              StackPermissionsImpl.class,
              WorkerImpl.class,
              MachineConfigImpl.class,
              SourceStorageImpl.class,
              ServerConfigImpl.class,
              StackImpl.class,
              CommandImpl.class,
              RecipeImpl.class,
              VolumeImpl.class)
          .addEntityClass(
              "org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl$Attribute")
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));

  bind(new TypeLiteral<TckRepository<AccountImpl>>() {})
      .toInstance(new JpaTckRepository<>(AccountImpl.class));
  bind(new TypeLiteral<TckRepository<WorkspaceImpl>>() {}).toInstance(new WorkspaceRepository());
  bind(new TypeLiteral<TckRepository<StackImpl>>() {}).toInstance(new StackRepository());
  bind(new TypeLiteral<TckRepository<UserImpl>>() {})
      .toInstance(new JpaTckRepository<>(UserImpl.class));
  bind(new TypeLiteral<TckRepository<WorkerImpl>>() {})
      .toInstance(new JpaTckRepository<>(WorkerImpl.class));
  bind(new TypeLiteral<TckRepository<StackPermissionsImpl>>() {})
      .toInstance(new JpaTckRepository<>(StackPermissionsImpl.class));

  bind(new TypeLiteral<PermissionsDao<StackPermissionsImpl>>() {})
      .to(JpaStackPermissionsDao.class);

  bind(new TypeLiteral<AbstractPermissionsDomain<WorkerImpl>>() {})
      .to(WorkerDaoTest.TestDomain.class);
  bind(new TypeLiteral<AbstractPermissionsDomain<StackPermissionsImpl>>() {})
      .to(StackPermissionsDaoTest.TestDomain.class);

  bind(WorkerDao.class).to(JpaWorkerDao.class);
  bind(WorkspaceDao.class).to(JpaWorkspaceDao.class);
  bind(StackDao.class).to(JpaStackDao.class);
}
 
开发者ID:eclipse,项目名称:che,代码行数:56,代码来源:WorkspaceTckModule.java


示例15: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(
              AccountImpl.class,
              UserImpl.class,
              WorkspaceImpl.class,
              WorkspaceConfigImpl.class,
              ProjectConfigImpl.class,
              EnvironmentImpl.class,
              StackPermissionsImpl.class,
              WorkerImpl.class,
              MachineConfigImpl.class,
              SourceStorageImpl.class,
              ServerConfigImpl.class,
              StackImpl.class,
              CommandImpl.class,
              RecipeImpl.class,
              VolumeImpl.class)
          .addEntityClass(
              "org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl$Attribute")
          .setExceptionHandler(H2ExceptionHandler.class)
          .build());

  bind(new TypeLiteral<AbstractPermissionsDomain<StackPermissionsImpl>>() {})
      .to(StackPermissionsDaoTest.TestDomain.class);
  bind(new TypeLiteral<PermissionsDao<StackPermissionsImpl>>() {})
      .to(JpaStackPermissionsDao.class);
  bind(new TypeLiteral<TckRepository<StackPermissionsImpl>>() {})
      .toInstance(new JpaTckRepository<>(StackPermissionsImpl.class));
  bind(new TypeLiteral<TckRepository<StackImpl>>() {})
      .toInstance(new JpaTckRepository<>(StackImpl.class));

  bind(new TypeLiteral<AbstractPermissionsDomain<WorkerImpl>>() {})
      .to(WorkerDaoTest.TestDomain.class);

  bind(WorkerDao.class).to(JpaWorkerDao.class);
  bind(new TypeLiteral<TckRepository<WorkerImpl>>() {})
      .toInstance(new JpaTckRepository<>(WorkerImpl.class));
  bind(new TypeLiteral<TckRepository<UserImpl>>() {})
      .toInstance(new JpaTckRepository<>(UserImpl.class));
  bind(new TypeLiteral<TckRepository<AccountImpl>>() {})
      .toInstance(new JpaTckRepository<>(AccountImpl.class));

  bind(new TypeLiteral<TckRepository<WorkspaceImpl>>() {})
      .toInstance(new JpaTckRepository<>(WorkspaceImpl.class));

  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(DBInitializer.class).asEagerSingleton();
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));
}
 
开发者ID:eclipse,项目名称:che,代码行数:57,代码来源:JpaTckModule.java


示例16: configure

import org.eclipse.che.core.db.schema.SchemaInitializer; //导入依赖的package包/类
@Override
protected void configure() {
  H2DBTestServer server = H2DBTestServer.startDefault();
  install(
      new PersistTestModuleBuilder()
          .setDriver(Driver.class)
          .runningOn(server)
          .addEntityClasses(
              UserImpl.class,
              AccountImpl.class,
              FactoryImpl.class,
              OnAppClosedImpl.class,
              OnProjectsLoadedImpl.class,
              OnAppLoadedImpl.class,
              ActionImpl.class,
              ButtonImpl.class,
              IdeImpl.class,
              WorkspaceConfigImpl.class,
              ProjectConfigImpl.class,
              EnvironmentImpl.class,
              RecipeImpl.class,
              MachineImpl.class,
              MachineConfigImpl.class,
              SourceStorageImpl.class,
              ServerConfigImpl.class,
              CommandImpl.class,
              VolumeImpl.class)
          .addEntityClass(
              "org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl$Attribute")
          .setExceptionHandler(H2ExceptionHandler.class)
          .setProperty("eclipselink.logging.level", "OFF")
          .build());
  bind(DBInitializer.class).asEagerSingleton();
  bind(SchemaInitializer.class)
      .toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
  bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));

  bind(FactoryDao.class).to(JpaFactoryDao.class);

  bind(new TypeLiteral<TckRepository<FactoryImpl>>() {})
      .toInstance(new JpaTckRepository<>(FactoryImpl.class));
  bind(new TypeLiteral<TckRepository<UserImpl>>() {})
      .toInstance(new JpaTckRepository<>(UserImpl.class));
}
 
开发者ID:eclipse,项目名称:che,代码行数:45,代码来源:FactoryTckModule.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Composite类代码示例发布时间:2022-05-16
下一篇:
Java TimeType类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap