SHARE
TWEET

Untitled

a guest Apr 19th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import {Entity, model, property, belongsTo} from '@loopback/repository';
  2. import {User} from './user.model';
  3. import {Role} from './role.model';
  4.  
  5. @model()
  6. export class UserRole extends Entity {
  7.   @property({
  8.     type: 'number',
  9.     id: true,
  10.     generated: true,
  11.   })
  12.   id?: number;
  13.  
  14.   @belongsTo(() => User)
  15.   userId: string;
  16.  
  17.   @belongsTo(() => Role)
  18.   roleId: string;
  19.  
  20.   constructor(data?: Partial<UserRole>) {
  21.     super(data);
  22.   }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top