CandidateEntity
@Entity({ name: 'users' })
export class CandidateEntity {
@PrimaryGeneratedColumn()
public id: number;
@OneToOne(() => CandidateEmployeeInfoEntity, employeeInfo => employeeInfo.candidate)
public employeeInfo: CandidateEmployeeInfoEntity;
}
Run Code Online (Sandbox Code Playgroud)
EmployeeInfoEntity
@Entity({ name: 'candidates_employee_infos' })
export class CandidateEmployeeInfoEntity {
@PrimaryGeneratedColumn()
public id: number;
@Column({ type: 'bool', nullable: false })
public relocation: boolean;
@Column({ type: 'text', nullable: true })
public softSkills: string;
@OneToOne(() => CandidateEntity, candidate => candidate.employeeInfo)
public candidate: CandidateEntity;
@Column({ type: 'integer' })
public candidateId: number;
}
Run Code Online (Sandbox Code Playgroud)
我创建查询以从数据库中的 104 行中选择前 25 行
const {
perPage = …Run Code Online (Sandbox Code Playgroud)