// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.googlesource.gerrit.plugins.verifystatus.server.schema;

import static com.google.inject.Scopes.SINGLETON;

import com.google.gerrit.extensions.config.FactoryModule;
import com.google.gwtorm.jdbc.Database;
import com.google.gwtorm.server.SchemaFactory;
import com.google.inject.TypeLiteral;
import com.googlesource.gerrit.plugins.verifystatus.server.CiDb;

/** Loads the database with standard dependencies. */
public class CiDatabaseModule extends FactoryModule {
  @Override
  protected void configure() {
    bind(new TypeLiteral<SchemaFactory<CiDb>>() {})
        .to(new TypeLiteral<Database<CiDb>>() {})
        .in(SINGLETON);
    bind(new TypeLiteral<Database<CiDb>>() {}).toProvider(CiDbDatabaseProvider.class).in(SINGLETON);
  }
}
