typeorm#OneToMany TypeScript Examples

The following examples show how to use typeorm#OneToMany. 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.ts    From crossfeed with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
/**
   * Corresponds to "organization" property of ScanTask.
   * Deprecated, replaced by "allScanTasks" property.
   */
  @OneToMany((type) => ScanTask, (scanTask) => scanTask.organization, {
    onDelete: 'CASCADE',
    onUpdate: 'CASCADE'
  })
  scanTasks: ScanTask[];
Example #2
Source File: Handle.ts    From bluebubbles-server with Apache License 2.0 5 votes vote down vote up
@OneToMany(type => Message, message => message.handle)
    @JoinColumn({ name: "ROWID", referencedColumnName: "handle_id" })
    messages: Message[];
Example #3
Source File: category.ts    From Corsace with MIT License 5 votes vote down vote up
@OneToMany(() => Nomination, nomination => nomination.category)
    nominations!: Nomination[];
Example #4
Source File: attribute-value.entity.ts    From Cromwell with MIT License 5 votes vote down vote up
@OneToMany(() => AttributeToProduct, attribute => attribute.attributeValue, {
        cascade: true,
    })
    attributeToProduct?: AttributeToProduct[];
Example #5
Source File: Orphanage.ts    From NLW-3.0 with MIT License 5 votes vote down vote up
@OneToMany(() => Image, image => image.orphanage, {
		cascade: ['insert', 'update'],
	})
	@JoinColumn({ name: 'orphanage_id' })
	images: Image[];
Example #6
Source File: Application.ts    From Designer-Server with GNU General Public License v3.0 5 votes vote down vote up
@OneToMany(type => TrafficConfig, trafficConfig => trafficConfig.application)
  trafficConfigs: TrafficConfig[];
Example #7
Source File: Orphanage.ts    From happy with MIT License 5 votes vote down vote up
@OneToMany(() => Image, image => image.orphanage, {
    cascade: ['insert', 'update']
  })
  @JoinColumn({ name: 'orphanage_id' })
  images: Image[];
Example #8
Source File: Order.ts    From rocketseat-gostack-11-desafios with MIT License 5 votes vote down vote up
@OneToMany(() => OrdersProducts, ordersProducts => ordersProducts.order, {
    cascade: true,
  })
  order_products: OrdersProducts[];
Example #9
Source File: ActionPremise.ts    From context-mod with MIT License 5 votes vote down vote up
@OneToMany(type => ActionResultEntity, obj => obj.premise) // note: we will create author property in the Photo class below
    actionResults!: ActionResultEntity[]
Example #10
Source File: cart.ts    From nodeJS-express-postgresql with MIT License 5 votes vote down vote up
@OneToMany(() => CartItem, cartitem => cartitem.cartid)
  cItem: CartItem[];
Example #11
Source File: Post.ts    From jaebook-server with MIT License 5 votes vote down vote up
@OneToMany((type) => PostComment, (postComment) => postComment.post)
  comments: PostComment[];
Example #12
Source File: User.ts    From hotseat-api with MIT License 5 votes vote down vote up
@OneToMany(() => Appointment, appointment => appointment.customer)
  appointments: Appointment[];
Example #13
Source File: posts.entity.ts    From NestJs-youtube with MIT License 5 votes vote down vote up
@OneToMany(
    type => CommentEntity,
    (comment: CommentEntity) => comment.post,
    { onUpdate: 'CASCADE', onDelete: 'CASCADE' },
  )
  comments: CommentEntity[];