Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Column, Entity } from 'entitype';
@Entity('strings')
export class String {
@Column({ columnName: `string_id`, type: `int(11)`, nullable: false, generated: true, primaryKey: true, default: null })
stringId: number;
@Column({ columnName: `string_data`, type: `varchar(255)`, default: null })
stringData?: string;
}
import { Column, Entity, ManyToMany, OneToMany } from 'entitype';
import { Employeeterritory } from './employeeterritory';
import { Order } from './order';
import { Territory } from './territory';
@Entity('employees')
export class Employee {
@Column({ columnName: `EmployeeID`, type: `int(11)`, nullable: false, generated: true, primaryKey: true, default: null })
employeeId: number;
@Column({ columnName: `LastName`, type: `varchar(255)`, default: null })
lastName?: string;
@Column({ columnName: `FirstName`, type: `varchar(255)`, default: null })
firstName?: string;
@Column({ columnName: `Title`, type: `varchar(255)`, default: null })
title?: string;
@Column({ columnName: `TitleOfCourtesy`, type: `varchar(255)`, default: null })
titleOfCourtesy?: string;
import { Column, Entity, ManyToMany, OneToMany } from 'entitype';
import { EmployeePrivilege } from './employee-privilege';
import { Order } from './order';
import { Privilege } from './privilege';
import { PurchaseOrder } from './purchase-order';
@Entity('employees')
export class Employee {
@Column({ columnName: `id`, type: `int(11)`, nullable: false, generated: true, primaryKey: true, default: null })
id: number;
@Column({ columnName: `company`, type: `varchar(50)`, default: null, index: true })
company?: string;
@Column({ columnName: `last_name`, type: `varchar(50)`, default: null, index: true })
lastName?: string;
@Column({ columnName: `first_name`, type: `varchar(50)`, default: null, index: true })
firstName?: string;
@Column({ columnName: `email_address`, type: `varchar(50)`, default: null })
emailAddress?: string;
import { Column, Entity, ManyToMany, OneToMany } from 'entitype';
import { Customercustomerdemo } from './customercustomerdemo';
import { Customerdemographic } from './customerdemographic';
import { Order } from './order';
@Entity('customers')
export class Customer {
@Column({ columnName: `CustomerID`, type: `varchar(255)`, nullable: false, primaryKey: true, default: null })
customerId: string;
@Column({ columnName: `CompanyName`, type: `varchar(255)`, default: null })
companyName?: string;
@Column({ columnName: `ContactName`, type: `varchar(255)`, default: null })
contactName?: string;
@Column({ columnName: `ContactTitle`, type: `varchar(255)`, default: null })
contactTitle?: string;
@Column({ columnName: `Address`, type: `varchar(255)`, default: null })
address?: string;
import { Column, Entity, OneToMany } from 'entitype';
import { Order } from './order';
@Entity('customers')
export class Customer {
@Column({ columnName: `id`, type: `int(11)`, nullable: false, generated: true, primaryKey: true, default: null })
id: number;
@Column({ columnName: `company`, type: `varchar(50)`, default: null, index: true })
company?: string;
@Column({ columnName: `last_name`, type: `varchar(50)`, default: null, index: true })
lastName?: string;
@Column({ columnName: `first_name`, type: `varchar(50)`, default: null, index: true })
firstName?: string;
@Column({ columnName: `email_address`, type: `varchar(50)`, default: null })
emailAddress?: string;
import { Column, Entity, ManyToOne } from 'entitype';
import { Order } from './order';
@Entity('invoices')
export class Invoice {
@Column({ columnName: `id`, type: `int(11)`, nullable: false, generated: true, primaryKey: true, default: null })
id: number;
@Column({ columnName: `order_id`, type: `int(11)`, default: null, index: true })
orderId?: number;
@Column({ columnName: `invoice_date`, type: `datetime`, default: null })
invoiceDate?: Date;
@Column({ columnName: `due_date`, type: `datetime`, default: null })
dueDate?: Date;
@Column({ columnName: `tax`, type: `decimal(19,4)`, default: 0.0000 })
tax?: string;
import { Column, Entity, OneToMany } from 'entitype';
import { PurchaseOrder } from './purchase-order';
@Entity('suppliers')
export class Supplier {
@Column({ columnName: `id`, type: `int(11)`, nullable: false, generated: true, primaryKey: true, default: null })
id: number;
@Column({ columnName: `company`, type: `varchar(50)`, default: null, index: true })
company?: string;
@Column({ columnName: `last_name`, type: `varchar(50)`, default: null, index: true })
lastName?: string;
@Column({ columnName: `first_name`, type: `varchar(50)`, default: null, index: true })
firstName?: string;
@Column({ columnName: `email_address`, type: `varchar(50)`, default: null })
emailAddress?: string;
import { Column, Entity, OneToMany } from 'entitype';
import { Product } from './product';
@Entity('suppliers')
export class Supplier {
@Column({ columnName: `SupplierID`, type: `int(11)`, nullable: false, generated: true, primaryKey: true, default: null })
supplierId: number;
@Column({ columnName: `CompanyName`, type: `varchar(255)`, nullable: false, default: null })
companyName: string;
@Column({ columnName: `ContactName`, type: `varchar(255)`, default: null })
contactName?: string;
@Column({ columnName: `ContactTitle`, type: `varchar(255)`, default: null })
contactTitle?: string;
@Column({ columnName: `Address`, type: `varchar(255)`, default: null })
address?: string;
import { Column, Entity, ManyToMany } from 'entitype';
import { Employee } from './employee';
import { EmployeePrivilege } from './employee-privilege';
@Entity('privileges')
export class Privilege {
@Column({ columnName: `id`, type: `int(11)`, nullable: false, generated: true, primaryKey: true, default: null })
id: number;
@Column({ columnName: `privilege_name`, type: `varchar(50)`, default: null })
privilegeName?: string;
@ManyToMany(type => Employee, joinType => EmployeePrivilege, x => x.privilegeId, x => x.employeeId)
employeePrivileges: Employee[];
}
import { Column, Entity, ManyToMany, ManyToOne } from 'entitype';
import { Employee } from './employee';
import { Employeeterritory } from './employeeterritory';
import { Region } from './region';
@Entity('territories')
export class Territory {
@Column({ columnName: `TerritoryID`, type: `varchar(255)`, nullable: false, primaryKey: true, default: null })
territoryId: string;
@Column({ columnName: `TerritoryDescription`, type: `varchar(255)`, nullable: false, default: null })
territoryDescription: string;
@Column({ columnName: `RegionID`, type: `int(11)`, nullable: false, default: null, index: true })
regionId: number;
@ManyToMany(type => Employee, joinType => Employeeterritory, x => x.territoryId, x => x.employeeId)
employeeterritories: Employee[];
@ManyToOne(type => Territory, x => x.regionId)
region: Region;