typeorm#JoinTable TypeScript Examples

The following examples show how to use typeorm#JoinTable. 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: 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 #2
Source File: Obligation.ts    From barista with Apache License 2.0 6 votes vote down vote up
@ApiProperty({ type: type => License, isArray: true })
  @ManyToMany(type => License, license => license.obligations, {
    nullable: true,
  })
  @JoinTable({
    name: 'license_obligations_obligation',
    joinColumn: {
      name: 'obligationCode',
      referencedColumnName: 'code',
    },
    inverseJoinColumn: {
      name: 'licenseCode',
      referencedColumnName: 'code',
    },
  })
  licenses: License[];
Example #3
Source File: scan.ts    From crossfeed with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
/**
   * If the scan is granular, specifies organization tags that the
   * scan will run on.
   */
  @ManyToMany((type) => OrganizationTag, (tag) => tag.scans, {
    onDelete: 'CASCADE',
    onUpdate: 'CASCADE'
  })
  @JoinTable()
  tags: OrganizationTag[];
Example #4
Source File: user.ts    From MyAPI with MIT License 6 votes vote down vote up
@ApiProperty({ description: 'Document type associated with the user' })
  @IsNotEmpty({
    message: 'The type of document is required'
  })
  @ManyToOne(() => DocumentType, documentType => documentType.users, {
    cascade: true
  })
  @JoinTable()
  documentType: DocumentType
Example #5
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 #6
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 #7
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 #8
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 #9
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 #10
Source File: GrowMap.ts    From liferay-grow with MIT License 5 votes vote down vote up
@Field(() => [KnowledgeSkillDetails], { nullable: true })
  @JoinTable({ name: 'grow_map_knowledge_skill_details' })
  @ManyToMany(() => KnowledgeSkillDetails, { onDelete: 'CASCADE' })
  knowledgeSkillDetails: KnowledgeSkillDetails[];
Example #11
Source File: Subcourse.ts    From backend with MIT License 5 votes vote down vote up
@ManyToMany(type => Student, student => student.subcourses, {
        eager: true
    })
    @JoinTable()
    instructors: Student[];
Example #12
Source File: user.ts    From MyAPI with MIT License 5 votes vote down vote up
@ApiProperty({ description: 'Role associated with the user' })
  @ManyToOne(() => Role, role => role.users, {
    cascade: true
  })
  @JoinTable()
  role: Role
Example #13
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 #14
Source File: contact-info.entity.ts    From nestjs-starter with MIT License 5 votes vote down vote up
@OneToMany((type) => ContactAddress, (address) => address.contactInfo, { cascade: true, eager: true })
  @JoinTable()
  addresses: ContactAddress[];
Example #15
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 #16
Source File: Employee.ts    From type-graphql-dataloader with MIT License 5 votes vote down vote up
@Field((type) => [Cert])
  @ManyToMany((type) => Cert, (cert) => cert.employees, { lazy: true })
  @JoinTable()
  @TypeormLoader((type) => Cert, (employee: Employee) => employee.certIds)
  certs: Lazy<Cert[]>;
Example #17
Source File: Assessment.ts    From bulwark with MIT License 5 votes vote down vote up
@ManyToMany((type) => User)
  @JoinTable()
  testers: User[];
Example #18
Source File: CashAction.ts    From cashcash-desktop with MIT License 5 votes vote down vote up
@ManyToMany((type) => CashAccount, (cashAccount) => cashAccount.cashActionList)
    @JoinTable({
        name: 'cash_account_action_list_cash_action',
        joinColumns: [{ name: 'cashActionId', referencedColumnName: 'id' }],
        inverseJoinColumns: [{ name: 'cashAccountId', referencedColumnName: 'id' }],
    })
    cashAccountList: CashAccount[];
Example #19
Source File: Chat.ts    From bluebubbles-server with Apache License 2.0 5 votes vote down vote up
@ManyToMany(type => Handle)
    @JoinTable({
        name: "chat_handle_join",
        joinColumns: [{ name: "chat_id" }],
        inverseJoinColumns: [{ name: "handle_id" }]
    })
    participants: Handle[];
Example #20
Source File: guestRequest.ts    From Corsace with MIT License 5 votes vote down vote up
@ManyToOne(() => Beatmap, beatmap => beatmap.guestRequests, {
        nullable: false,
        eager: true,
    })
    @JoinTable()
    beatmap!: Beatmap;
Example #21
Source File: order.entity.ts    From Cromwell with MIT License 5 votes vote down vote up
@JoinTable()
    @ManyToMany(type => Coupon)
    coupons?: Coupon[] | null;
Example #22
Source File: License.ts    From barista with Apache License 2.0 5 votes vote down vote up
@ApiProperty({ type: type => LicenseScanResultItem, isArray: true })
  @OneToMany(type => LicenseScanResultItem, licenseScanResultItem => licenseScanResultItem.license, { nullable: true })
  @JoinTable()
  licenseScanResultItems: LicenseScanResultItem[];
Example #23
Source File: CashAccount.ts    From cashcash-desktop with MIT License 5 votes vote down vote up
@ManyToMany((type) => CashImportConfig, (cashImportConfig) => cashImportConfig.cashAccountList)
    @JoinTable({
        name: 'cash_account_import_config_list_cash_import_config',
        joinColumns: [{ name: 'cashAccountId', referencedColumnName: 'id' }],
        inverseJoinColumns: [{ name: 'cashImportConfigId', referencedColumnName: 'id' }],
    })
    importConfigList: CashImportConfig[];
Example #24
Source File: Category.ts    From typeorm-uml with MIT License 5 votes vote down vote up
@ManyToMany( () => Product, ( product ) => product.categories )
	@JoinTable( {
		name: 'product_category',
		joinColumns: [ { name: 'categoryId', referencedColumnName: 'id' } ],
		inverseJoinColumns: [ { name: 'productId', referencedColumnName: 'id' } ],
		schema: 'shop',
	} )
	products: Product[];
Example #25
Source File: CashFilter.ts    From cashcash-desktop with MIT License 5 votes vote down vote up
@ManyToMany((type) => CashAccount, (cashAccount) => cashAccount.cashFilterList, { cascade: [] })
    @JoinTable({
        name: 'cash_account_filter_list_cash_filter',
        joinColumns: [{ name: 'cashFilterId', referencedColumnName: 'id' }],
        inverseJoinColumns: [{ name: 'cashAccountId', referencedColumnName: 'id' }],
    })
    cashAccountList: CashAccount[];
Example #26
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 #27
Source File: collections.entity.ts    From aqualink-app with MIT License 5 votes vote down vote up
@ManyToMany(() => Site)
  @JoinTable()
  sites: Site[];
Example #28
Source File: user.entity.ts    From typeorm-query-builder-wrapper with MIT License 5 votes vote down vote up
@ManyToMany(() => Photos, { cascade: true })
  @JoinTable()
  photos?: Photos[];
Example #29
Source File: ChatRoom.entity.ts    From bouncecode-cms with GNU General Public License v3.0 5 votes vote down vote up
@ManyToMany(
    () => UserEntity,
    user => user.chatRooms,
  )
  @JoinTable()
  attendees: UserEntity[];