typeorm#ManyToMany TypeScript Examples

The following examples show how to use typeorm#ManyToMany. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: organization-tag.ts    From crossfeed with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
/**
   * Organizations that are labeled with this tag
   */
  @ManyToMany((type) => Organization, (organization) => organization.tags, {
    onDelete: 'CASCADE',
    onUpdate: 'CASCADE'
  })
  @JoinTable()
  organizations: Organization[];
Example #2
Source File: Member.ts    From fosscord-server with GNU Affero General Public License v3.0 6 votes vote down vote up
@JoinTable({
		name: "member_roles",
		joinColumn: { name: "index", referencedColumnName: "index" },
		inverseJoinColumn: {
			name: "role_id",
			referencedColumnName: "id",
		},
	})
	@ManyToMany(() => Role, { cascade: true })
	roles: Role[];
Example #3
Source File: License.ts    From barista with Apache License 2.0 6 votes vote down vote up
@ApiProperty({ type: type => Obligation, isArray: true })
  @ManyToMany(type => Obligation, obligation => obligation.licenses, {
    nullable: true,
  })
  @JoinTable({
    name: 'license_obligations_obligation',
    joinColumn: {
      name: 'licenseCode',
      referencedColumnName: 'code',
    },
    inverseJoinColumn: {
      name: 'obligationCode',
      referencedColumnName: 'code',
    },
  })
  obligations: Obligation[];
Example #4
Source File: Product.ts    From typeorm-uml with MIT License 5 votes vote down vote up
@ManyToMany( () => Tag, ( tag ) => tag.products )
	@JoinTable( {
		name: 'product_tag',
		joinColumns: [ { name: 'productId', referencedColumnName: 'id' } ],
		inverseJoinColumns: [ { name: 'tagId', referencedColumnName: 'id' } ],
		schema: 'shop',
	} )
	tags: Tag[];
Example #5
Source File: auth_code.ts    From ts-oauth2-server with MIT License 5 votes vote down vote up
@ManyToMany(() => Scope, { onDelete: "CASCADE", onUpdate: "CASCADE" })
  @JoinTable({
    name: "oauth_auth_code_scopes",
    joinColumn: { name: "authCodeCode", referencedColumnName: "code" },
    inverseJoinColumn: { name: "scopeId", referencedColumnName: "id" },
  })
  scopes!: Scope[];
Example #6
Source File: Message.ts    From fosscord-server with GNU Affero General Public License v3.0 5 votes vote down vote up
@JoinTable({ name: "message_stickers" })
	@ManyToMany(() => Sticker, { cascade: true, onDelete: "CASCADE" })
	sticker_items?: Sticker[];
Example #7
Source File: Tag.ts    From typeorm-uml with MIT License 5 votes vote down vote up
@ManyToMany( () => Product, ( product ) => product.tags )
	products: Product[];
Example #8
Source File: token.ts    From ts-oauth2-server with MIT License 5 votes vote down vote up
@ManyToMany(() => Scope, { onDelete: "CASCADE", onUpdate: "CASCADE" })
  @JoinTable({
    name: "oauth_token_scopes",
    joinColumn: { name: "tokenAccessToken", referencedColumnName: "accessToken" },
    inverseJoinColumn: { name: "scopeId", referencedColumnName: "id" },
  })
  scopes!: Scope[];
Example #9
Source File: Product.ts    From typeorm-uml with MIT License 5 votes vote down vote up
@ManyToMany( () => Category, ( category ) => category.products )
	categories: Category[];
Example #10
Source File: Subcourse.ts    From backend with MIT License 5 votes vote down vote up
@ManyToMany(type => Pupil, pupil => pupil.queuedSubcourses, {
        eager: true
    })
    @JoinTable()
    waitingList: Pupil[];
Example #11
Source File: queue.entity.ts    From office-hours with GNU General Public License v3.0 5 votes vote down vote up
@ManyToMany((type) => UserModel, (user) => user.queues)
  @JoinTable()
  staffList: UserModel[];
Example #12
Source File: User.ts    From bulwark with MIT License 5 votes vote down vote up
@ManyToMany(() => Team, (team) => team.users)
  teams: Team[];
Example #13
Source File: PersonalComputer.ts    From type-graphql-dataloader with MIT License 5 votes vote down vote up
@Field((type) => [ApplicationSoftware])
  @ManyToMany((type) => ApplicationSoftware, (app) => app.installedComputers)
  @JoinTable()
  @TypeormLoader()
  installedApps: ApplicationSoftware[];
Example #14
Source File: client.ts    From ts-oauth2-server with MIT License 5 votes vote down vote up
@ManyToMany(() => Scope, { onDelete: "CASCADE", onUpdate: "CASCADE" })
  @JoinTable({
    name: "oauth_client_scopes",
    joinColumn: { name: "clientId", referencedColumnName: "id" },
    inverseJoinColumn: { name: "scopeId", referencedColumnName: "id" },
  })
  scopes!: Scope[];
Example #15
Source File: user.entity.ts    From office-hours with GNU General Public License v3.0 5 votes vote down vote up
@Exclude()
  @ManyToMany((type) => QueueModel, (queue) => queue.staffList)
  queues: QueueModel[];
Example #16
Source File: user.entity.ts    From radiopanel with GNU General Public License v3.0 5 votes vote down vote up
@ManyToMany(() => Role, role => role.users)
	@JoinTable({
		name: 'user_role'
	})
	public roles: Role[];
Example #17
Source File: UserDetails.ts    From liferay-grow with MIT License 5 votes vote down vote up
@Field(() => [Team], { nullable: true })
  @JoinTable({ name: 'user_details_teams' })
  @ManyToMany(() => Team)
  teams?: Team[];
Example #18
Source File: Role.ts    From gobarber-project with MIT License 5 votes vote down vote up
@ManyToMany(() => Permission)
  @JoinTable({
    name: "permissions_roles",
    joinColumns: [{ name: "role_id" }],
    inverseJoinColumns: [{ name: "permission_id" }],
  })
  permission: Permission[];
Example #19
Source File: ExpertData.ts    From backend with MIT License 5 votes vote down vote up
@ManyToMany((type) => ExpertiseTag, expertiseTags => expertiseTags.expertData, {
        eager: true
    })
    @JoinTable()
    expertiseTags: ExpertiseTag[];
Example #20
Source File: post.entity.ts    From Cromwell with MIT License 5 votes vote down vote up
@Field(type => [Tag], { nullable: true })
    @JoinTable()
    @ManyToMany(type => Tag)
    tags?: Tag[] | null;
Example #21
Source File: CashImportConfig.ts    From cashcash-desktop with MIT License 5 votes vote down vote up
@ManyToMany((type) => CashAccount, (cashAccount) => cashAccount.importConfigList)
    cashAccountList: CashAccount[];
Example #22
Source File: product.entity.ts    From Cromwell with MIT License 5 votes vote down vote up
@ManyToMany(type => ProductCategory, category => category.products)
    @JoinTable()
    categories?: TProductCategory[] | null;
Example #23
Source File: Student.ts    From Typescript_TypeORM with Apache License 2.0 5 votes vote down vote up
@ManyToMany(type => Discipline, { eager: true })
  @JoinTable()
  discipline: Discipline[];
Example #24
Source File: order.entity.ts    From Cromwell with MIT License 5 votes vote down vote up
@JoinTable()
    @ManyToMany(type => Coupon)
    coupons?: Coupon[] | null;
Example #25
Source File: user.ts    From Corsace with MIT License 5 votes vote down vote up
@ManyToMany(() => Nomination, nomination => nomination.nominators)
    @JoinTable()
    nominations!: Nomination[];
Example #26
Source File: Message.ts    From bluebubbles-server with Apache License 2.0 5 votes vote down vote up
@ManyToMany(type => Attachment)
    @JoinTable({
        name: "message_attachment_join",
        joinColumns: [{ name: "message_id" }],
        inverseJoinColumns: [{ name: "attachment_id" }]
    })
    attachments: Attachment[];
Example #27
Source File: organization.ts    From crossfeed with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
/**
   * Corresponds to "organizations" property of ScanTask.
   */
  @ManyToMany((type) => ScanTask, (scanTask) => scanTask.organizations, {
    onDelete: 'CASCADE',
    onUpdate: 'CASCADE'
  })
  allScanTasks: ScanTask[];
Example #28
Source File: Pupil.ts    From backend with MIT License 5 votes vote down vote up
@ManyToMany(type => Subcourse, subcourse => subcourse.participants)
    subcourses: Subcourse[];
Example #29
Source File: Attachment.ts    From bluebubbles-server with Apache License 2.0 5 votes vote down vote up
@ManyToMany(type => Message)
    @JoinTable({
        name: "message_attachment_join",
        joinColumns: [{ name: "attachment_id" }],
        inverseJoinColumns: [{ name: "message_id" }]
    })
    messages: Message[];