typeorm#ManyToOne TypeScript Examples
The following examples show how to use
typeorm#ManyToOne.
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: BomLicenseException.ts From barista with Apache License 2.0 | 6 votes |
/**
* The ProjectScanStatus
*/
@ApiProperty({ type: type => ProjectScanStatusType })
@ManyToOne(type => ProjectScanStatusType, { eager: true })
@JoinColumn({
name: 'project_scan_status_type_code',
referencedColumnName: 'code',
})
projectScanStatus: ProjectScanStatusType;
Example #2
Source File: cart-item.ts From nodeJS-express-postgresql with MIT License | 5 votes |
@ManyToOne(() => Cart, cart => cart.cItem, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
@JoinColumn({ name: 'cartid' })
cartid: Cart;
Example #3
Source File: TotalStat.ts From context-mod with MIT License | 5 votes |
@ManyToOne(type => ManagerEntity)
@JoinColumn({name: 'managerId'})
manager!: ManagerEntity;
Example #4
Source File: cart-item.ts From nodeJS-express-postgresql with MIT License | 5 votes |
@ManyToOne(() => Product, prod => prod.cItem, { onDelete: 'CASCADE', onUpdate: 'CASCADE' })
@JoinColumn({ name: 'productid' })
prodid: Product;
Example #5
Source File: Post.ts From jaebook-server with MIT License | 5 votes |
@ManyToOne((type) => User, (user) => user.id, {
cascade: true,
onDelete: "CASCADE",
})
@JoinColumn({ name: "user_id" })
user: User;
Example #6
Source File: Appointment.ts From hotseat-api with MIT License | 5 votes |
@ManyToOne(() => User, user => user.appointments)
@JoinColumn({ name: 'customer_id' })
customer: User;
Example #7
Source File: comments.entity.ts From NestJs-youtube with MIT License | 5 votes |
@ManyToOne(
() => UserEntity,
(user: UserEntity) => user.posts,
{ onUpdate: 'CASCADE', onDelete: 'CASCADE' },
)
@JoinColumn({ name: 'user_id' })
user: UserEntity;
Example #8
Source File: BomLicenseException.ts From barista with Apache License 2.0 | 5 votes |
@ApiProperty({ type: type => Project })
@ManyToOne(type => Project, project => project.licenseExceptions, {
eager: true,
onDelete: 'CASCADE',
})
project: Project;
Example #9
Source File: CashRule.ts From cashcash-desktop with MIT License | 5 votes |
@ManyToOne((type) => CashAction, (cashAction) => cashAction.cashRuleList, {
cascade: ['insert', 'update', 'remove'],
})
@JoinColumn({ name: 'actionId', referencedColumnName: 'id' })
action: CashAction;
Example #10
Source File: survey-media.entity.ts From aqualink-app with MIT License | 5 votes |
@ManyToOne(() => SiteSurveyPoint, {
onDelete: 'SET NULL',
nullable: true,
})
@JoinColumn({ name: 'survey_point_id' })
surveyPoint: SiteSurveyPoint | null;
Example #11
Source File: Lesson.ts From Typescript_TypeORM with Apache License 2.0 | 5 votes |
@ManyToOne(type => Discipline, lessons => Lesson, { eager: true })
discipline: Discipline;
Example #12
Source File: question.entity.ts From nest-js-quiz-manager with MIT License | 5 votes |
@ApiProperty({
description: 'Quiz of the question',
})
@ManyToOne(() => Quiz, (quiz) => quiz.questions)
quiz: Quiz;
Example #13
Source File: purse.model.ts From nest_transact with MIT License | 5 votes |
@ApiModelPropertyOptional({
type: () => User,
})
@ManyToOne(() => User, user => user.purses)
user?: User;
Example #14
Source File: CashSplitSum.ts From cashcash-desktop with MIT License | 5 votes |
@ManyToOne((type) => CashCurrency, (cashCurrency) => cashCurrency.cashSplitList)
@JoinColumn({ name: 'currencyId', referencedColumnName: 'id' })
currency: CashCurrency;
Example #15
Source File: ThreadItem.ts From Full-Stack-React-TypeScript-and-Node with MIT License | 5 votes |
@ManyToOne(() => Thread, (thread) => thread.threadItems)
thread: Thread;
Example #16
Source File: VulnerabilityStatusDeploymentType.ts From barista with Apache License 2.0 | 5 votes |
/**
* The SecurityScanResultItemStatusType
*/
@ApiProperty({ type: type => SecurityScanResultItemStatusType })
@ManyToOne(type => SecurityScanResultItemStatusType, { eager: true })
@JoinColumn({ name: 'security_status_code', referencedColumnName: 'code' })
securityStatus: SecurityScanResultItemStatusType;
Example #17
Source File: Thread.ts From Full-Stack-React-TypeScript-and-Node with MIT License | 5 votes |
@ManyToOne(() => User, (user: User) => user.threads)
user: User;
Example #18
Source File: CashBudgetSplit.ts From cashcash-desktop with MIT License | 5 votes |
@ManyToOne((type) => CashCurrency, (cashCurrency) => cashCurrency.cashSplitList)
@JoinColumn({ name: 'currencyId', referencedColumnName: 'id' })
currency: CashCurrency;
Example #19
Source File: PointItems.ts From ecoleta with MIT License | 5 votes |
@ManyToOne(() => Point, point => point.point_items)
@JoinColumn({ name: 'point_id' })
point: Point;
Example #20
Source File: VulnerabilityStatusDeploymentType.ts From barista with Apache License 2.0 | 5 votes |
/**
* The DeploymentType
*/
@ApiProperty({ type: type => DeploymentType })
@ManyToOne(type => DeploymentType, { eager: true })
@JoinColumn({ name: 'deployment_type_code', referencedColumnName: 'code' })
deploymentType: DeploymentType;
Example #21
Source File: CashAccount.ts From cashcash-desktop with MIT License | 5 votes |
@ManyToOne((type) => CashAccount, (cashAccount) => cashAccount.children)
@JoinColumn({ name: 'parentAccountId', referencedColumnName: 'id' })
parentAccount: CashAccount;