How to use the @fullstack-one/db.OneToMany function in @fullstack-one/db

To help you get started, we’ve selected a few @fullstack-one/db examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fullstack-build / fullstack-one / examples / 2-orm-auth-graphql / models / User.ts View on Github external
@Column({ gqlType: "String", type: "character varying" })
  public lastname: string;

  @OneToOneJoinColumn((type) => Photo, { nullable: true })
  public photo?: Photo;

  @OneToMany((type) => Task, "user", { nullable: true })
  public tasks?: Task[];

  @Column({ enum: Size, enumName: "Size", nullable: true })
  public size?: Size;

  @Column({ enum: Gender, enumName: "Gender", gqlType: "String", type: "integer", nullable: true })
  public gender?: Gender;

  @OneToMany((type) => Represent, "prinzipal", { nullable: true })
  public prinzipalRepresent?: Represent;

  @OneToMany((type) => Represent, "agent", { nullable: true })
  public agentRepresent?: Represent;
}
github fullstack-build / fullstack-one / examples / 2-orm-auth-graphql / models / User.ts View on Github external
@OneToOneJoinColumn((type) => Photo, { nullable: true })
  public photo?: Photo;

  @OneToMany((type) => Task, "user", { nullable: true })
  public tasks?: Task[];

  @Column({ enum: Size, enumName: "Size", nullable: true })
  public size?: Size;

  @Column({ enum: Gender, enumName: "Gender", gqlType: "String", type: "integer", nullable: true })
  public gender?: Gender;

  @OneToMany((type) => Represent, "prinzipal", { nullable: true })
  public prinzipalRepresent?: Represent;

  @OneToMany((type) => Represent, "agent", { nullable: true })
  public agentRepresent?: Represent;
}
github fullstack-build / fullstack-one / examples / 2-orm-auth-graphql / models / User.ts View on Github external
})
export default class User extends BaseEntity {
  @PrimaryGeneratedColumn()
  @QueryPermissions(anyone())
  public id: number;

  @Column({ gqlType: "String", type: "character varying" })
  public firstname: string;

  @Column({ gqlType: "String", type: "character varying" })
  public lastname: string;

  @OneToOneJoinColumn((type) => Photo, { nullable: true })
  public photo?: Photo;

  @OneToMany((type) => Task, "user", { nullable: true })
  public tasks?: Task[];

  @Column({ enum: Size, enumName: "Size", nullable: true })
  public size?: Size;

  @Column({ enum: Gender, enumName: "Gender", gqlType: "String", type: "integer", nullable: true })
  public gender?: Gender;

  @OneToMany((type) => Represent, "prinzipal", { nullable: true })
  public prinzipalRepresent?: Represent;

  @OneToMany((type) => Represent, "agent", { nullable: true })
  public agentRepresent?: Represent;
}