How to use the @loopback/repository.repository.getter function in @loopback/repository

To help you get started, we’ve selected a few @loopback/repository examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / loopback-next / examples / todo-list / src / repositories / todo.repository.ts View on Github external
constructor(
    @inject('datasources.db') dataSource: juggler.DataSource,
    @repository.getter('TodoListRepository')
    protected todoListRepositoryGetter: Getter,
  ) {
    super(Todo, dataSource);

    this.todoList = this.createBelongsToAccessorFor(
      'todoList',
      todoListRepositoryGetter,
    );
    this.registerInclusionResolver('todoList', this.todoList.inclusionResolver);
  }
}
github gobackhuoxing / first-web-game-lb4 / firstgame / src / repositories / weapon.repository.ts View on Github external
constructor(
    @inject('datasources.mongo') dataSource: MongoDbDataSource,
    @repository.getter('CharacterRepository')
    protected characterRepositoryGetter: Getter,
  ) {
    super(Weapon, dataSource);

    //this.character = this.createBelongsToAccessorFor('character',characterRepositoryGetter);
  }
}
github gobackhuoxing / first-web-game-lb4 / firstgame / src / repositories / character.repository.ts View on Github external
constructor(
    @inject('datasources.mongo') dataSource: MongoDbDataSource,
    @repository.getter(ArmorRepository)
    protected armorRepositoryGetter: Getter,
    @repository.getter(WeaponRepository)
    protected weaponRepositoryGetter: Getter,
    @repository.getter(SkillRepository)
    protected skillRepositoryGetter: Getter,
  ) {
    super(Character, dataSource);
    this.armor = this.createHasOneRepositoryFactoryFor('armor', armorRepositoryGetter);
    this.weapon = this.createHasOneRepositoryFactoryFor('weapon', weaponRepositoryGetter);
    this.skill = this.createHasOneRepositoryFactoryFor('skill', skillRepositoryGetter);
  }
}
github strongloop / loopback-next / examples / todo-list / src / repositories / todo-list.repository.ts View on Github external
constructor(
    @inject('datasources.db') dataSource: juggler.DataSource,
    @repository.getter('TodoRepository')
    protected todoRepositoryGetter: Getter,
    @repository.getter('TodoListImageRepository')
    protected todoListImageRepositoryGetter: Getter,
  ) {
    super(TodoList, dataSource);

    this.todos = this.createHasManyRepositoryFactoryFor(
      'todos',
      todoRepositoryGetter,
    );

    this.registerInclusionResolver('todos', this.todos.inclusionResolver);

    this.image = this.createHasOneRepositoryFactoryFor(
      'image',
      todoListImageRepositoryGetter,
github gobackhuoxing / first-web-game-lb4 / firstgame / src / repositories / character.repository.ts View on Github external
constructor(
    @inject('datasources.mongo') dataSource: MongoDbDataSource,
    @repository.getter(ArmorRepository)
    protected armorRepositoryGetter: Getter,
    @repository.getter(WeaponRepository)
    protected weaponRepositoryGetter: Getter,
    @repository.getter(SkillRepository)
    protected skillRepositoryGetter: Getter,
  ) {
    super(Character, dataSource);
    this.armor = this.createHasOneRepositoryFactoryFor('armor', armorRepositoryGetter);
    this.weapon = this.createHasOneRepositoryFactoryFor('weapon', weaponRepositoryGetter);
    this.skill = this.createHasOneRepositoryFactoryFor('skill', skillRepositoryGetter);
  }
}
github strongloop / loopback-next / examples / todo-list / src / repositories / todo-list-image.repository.ts View on Github external
constructor(
    @inject('datasources.db') dataSource: DbDataSource,
    @repository.getter('TodoListRepository')
    protected todoListRepositoryGetter: Getter,
  ) {
    super(TodoListImage, dataSource);

    this.todoList = this.createBelongsToAccessorFor(
      'todoList',
      todoListRepositoryGetter,
    );

    this.registerInclusionResolver('todoList', this.todoList.inclusionResolver);
  }
}
github gobackhuoxing / first-web-game-lb4 / firstgame / src / repositories / character.repository.ts View on Github external
constructor(
    @inject('datasources.mongo') dataSource: MongoDbDataSource,
    @repository.getter(ArmorRepository)
    protected armorRepositoryGetter: Getter,
    @repository.getter(WeaponRepository)
    protected weaponRepositoryGetter: Getter,
    @repository.getter(SkillRepository)
    protected skillRepositoryGetter: Getter,
  ) {
    super(Character, dataSource);
    this.armor = this.createHasOneRepositoryFactoryFor('armor', armorRepositoryGetter);
    this.weapon = this.createHasOneRepositoryFactoryFor('weapon', weaponRepositoryGetter);
    this.skill = this.createHasOneRepositoryFactoryFor('skill', skillRepositoryGetter);
  }
}
github dofapi / dofapi / server / src / repositories / set.repository.ts View on Github external
constructor(
    @inject('datasources.db') dataSource: DbDataSource,
    @repository.getter(EquipmentRepository)
    protected equipmentRepositoryGetter: Getter,
    @repository.getter(WeaponRepository)
    protected weaponRepositoryGetter: Getter,
  ) {
    super(Set, dataSource);
    this.equipments = this.createHasManyRepositoryFactoryFor(
      'equipments',
      equipmentRepositoryGetter,
    );
    this.weapons = this.createHasManyRepositoryFactoryFor(
      'weapons',
      weaponRepositoryGetter,
    );
  }
github strongloop / loopback4-example-shopping / packages / shopping / src / repositories / user.repository.ts View on Github external
constructor(
    @inject('datasources.mongo') protected datasource: juggler.DataSource,
    @repository(OrderRepository) protected orderRepository: OrderRepository,
    @repository.getter('UserCredentialsRepository')
    protected userCredentialsRepositoryGetter: Getter<
      UserCredentialsRepository
    >,
  ) {
    super(User, datasource);
    this.userCredentials = this.createHasOneRepositoryFactoryFor(
      'userCredentials',
      userCredentialsRepositoryGetter,
    );
    this.orders = this.createHasManyRepositoryFactoryFor(
      'orders',
      async () => orderRepository,
    );
  }
github gobackhuoxing / first-web-game-lb4 / firstgame / src / repositories / armor.repository.ts View on Github external
constructor(
    @inject('datasources.mongo') dataSource: MongoDbDataSource,
    @repository.getter('CharacterRepository')
    protected characterRepositoryGetter: Getter,
  ) {
    super(Armor, dataSource);

    this.character = this.createBelongsToAccessorFor('character',characterRepositoryGetter);
  }
}