typeorm#OneToOne TypeScript Examples
The following examples show how to use
typeorm#OneToOne.
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 |
/**
* A convenience association to the license since there is no relationship with a LicenseScanResultItem
*/
@ApiProperty()
@OneToOne(type => License, {
eager: true,
nullable: false,
onDelete: 'NO ACTION',
})
@JoinColumn()
license: License;
Example #2
Source File: Desk.ts From type-graphql-dataloader with MIT License | 6 votes |
@Field((type) => Chair, { nullable: true })
@OneToOne((type) => Chair, (chair) => chair.desk, {
lazy: true,
nullable: true,
})
@TypeormLoader((type) => Chair, (chair: Chair) => chair.deskId, {
selfKey: true,
})
chair: Lazy<Chair | null>;
Example #3
Source File: KnowledgeGapsDetails.ts From liferay-grow with MIT License | 5 votes |
@JoinColumn()
@Field(() => KnowledgeSkill, { nullable: true })
@OneToOne(() => KnowledgeSkill, { createForeignKeyConstraints: false })
knowledgeSkill: KnowledgeSkill;
Example #4
Source File: user-auth.entity.ts From bank-server with MIT License | 5 votes |
@OneToOne(() => UserEntity, (user: UserEntity) => user.userAuth, {
nullable: false,
onDelete: 'CASCADE',
})
@JoinColumn()
user: UserEntity;
Example #5
Source File: UserDetails.ts From liferay-grow with MIT License | 5 votes |
@JoinColumn()
@Field(() => Role, { nullable: true })
@OneToOne(() => Role, { createForeignKeyConstraints: false })
role?: Role;
Example #6
Source File: Student.ts From backend with MIT License | 5 votes |
@OneToOne((type) => CertificateOfConduct, (cocScreening) => cocScreening.student, {
nullable: true,
cascade: true
})
certificateOfConduct: Promise<CertificateOfConduct>;
Example #7
Source File: GrowMap.ts From liferay-grow with MIT License | 5 votes |
@Field(() => User)
@OneToOne(() => User)
@JoinColumn()
user: User;
Example #8
Source File: program.entity.ts From gear-js with GNU General Public License v3.0 | 5 votes |
@OneToOne(() => Meta, { nullable: true, onDelete: 'CASCADE' })
@JoinColumn()
meta: Meta;
Example #9
Source File: Student.ts From backend with MIT License | 5 votes |
@OneToOne(type => RemissionRequest, remissionRequest => remissionRequest.student, {
nullable: true
})
remissionRequest: RemissionRequest;
Example #10
Source File: prof-section-groups.entity.ts From office-hours with GNU General Public License v3.0 | 5 votes |
@OneToOne((type) => UserModel)
@JoinColumn({ name: 'profId' })
prof: UserModel;
Example #11
Source File: Jira.ts From bulwark with MIT License | 5 votes |
@OneToOne((type) => Asset, (asset) => asset.jira, { onDelete: 'CASCADE' })
@JoinColumn()
asset: Asset;
Example #12
Source File: PersonalComputer.ts From type-graphql-dataloader with MIT License | 5 votes |
@Field((type) => Desk, { nullable: true })
@OneToOne((type) => Desk, (desk) => desk.desktopComputer, {
nullable: true,
lazy: true,
})
@JoinColumn()
@TypeormLoader()
placedAt: Lazy<Desk | null>;
Example #13
Source File: user.entity.ts From office-hours with GNU General Public License v3.0 | 5 votes |
@OneToOne((type) => PhoneNotifModel, (notif) => notif.user)
@Exclude()
phoneNotif: PhoneNotifModel;
Example #14
Source File: user-config.entity.ts From bank-server with MIT License | 5 votes |
@OneToOne(() => UserEntity, (user: UserEntity) => user.userConfig, {
nullable: false,
onDelete: 'CASCADE',
})
@JoinColumn()
user: UserEntity;
Example #15
Source File: last-registration-model.entity.ts From office-hours with GNU General Public License v3.0 | 5 votes |
@OneToOne((type) => UserModel)
@JoinColumn({ name: 'profId' })
prof: UserModel;
Example #16
Source File: user.entity.ts From nestjs-starter with MIT License | 5 votes |
@OneToOne((type) => ContactInfo, (info) => info.user, { cascade: true, eager: true })
@JoinTable()
contactInfo: ContactInfo;
Example #17
Source File: user-role.entity.ts From radiopanel with GNU General Public License v3.0 | 5 votes |
@OneToOne(() => Role, role => role.uuid, {
eager: true,
})
@JoinColumn()
public role: Role;
Example #18
Source File: cat.entity.ts From nestjs-paginate with MIT License | 5 votes |
@OneToOne(() => CatHomeEntity, (catHome) => catHome.cat, { nullable: true })
@JoinColumn()
home: CatHomeEntity
Example #19
Source File: user.entity.ts From bank-server with MIT License | 5 votes |
@OneToOne(
() => UserConfigEntity,
(userConfig: UserConfigEntity) => userConfig.user,
)
userConfig: UserConfigEntity;
Example #20
Source File: EntityRunState.ts From context-mod with MIT License | 5 votes |
@OneToOne(() => RunStateType)
@ManyToOne(() => RunStateType, undefined,{eager: true})
runType!: RunStateType
Example #21
Source File: user.ts From nodeJS-express-postgresql with MIT License | 5 votes |
@OneToOne(() => Cart, cart => cart.userid)
cartid = Cart;
Example #22
Source File: RunResultEntity.ts From context-mod with MIT License | 5 votes |
@OneToOne(() => AuthorFilterResult, {nullable: true, cascade: ['insert'], eager: true})
@JoinColumn({name: 'authorIs'})
_authorIs?: AuthorFilterResult
Example #23
Source File: CashAccount.ts From cashcash-desktop with MIT License | 5 votes |
@OneToOne((type) => CashBankInfo)
@JoinColumn({ name: 'bankInfoId', referencedColumnName: 'id' })
bankInfo: CashBankInfo;
Example #24
Source File: EntityRunState.ts From context-mod with MIT License | 5 votes |
@OneToOne(() => InvokeeType)
@ManyToOne(() => InvokeeType, undefined,{eager: true})
invokee!: InvokeeType
Example #25
Source File: Order.ts From rocketseat-gostack-11-desafios with MIT License | 5 votes |
@OneToOne(() => Customer)
@JoinColumn({ name: 'customer_id' })
customer: Customer;
Example #26
Source File: Service.ts From Designer-Server with GNU General Public License v3.0 | 5 votes |
@OneToOne(type => Meta, meta => meta.service, {nullable: true, onDelete: "SET NULL"})
@JoinColumn()
meta: Meta;
Example #27
Source File: account.ts From TypeScript-Login-Register with MIT License | 5 votes |
@OneToOne(() => AccountValidation)
@JoinColumn()
validation: AccountValidation;
Example #28
Source File: ChatRoom.entity.ts From bouncecode-cms with GNU General Public License v3.0 | 5 votes |
@OneToOne(
type => ChatMessageEntity,
message => message.lastMessage,
)
@JoinColumn()
lastMessage: ChatMessageEntity;
Example #29
Source File: user.entity.ts From 42_checkIn with GNU General Public License v3.0 | 5 votes |
@JoinColumn({ name: 'cardId' })
@OneToOne(() => Card)
private card: Card;