CoreEntity
// Entity Example@Entity("TestEntity",1) class TestEntity extends CoreEntity{ @Column({ canBeNull:true, dataType:"text" }) name:string|null @Column() simpleNumber:number @Column({ canBeNull:true, }) missingType:any @Column({ canBeNull:true, primaryKey:true }) primaryKeyNull:any @Column({ canBeNull:true, dataType:"float", foreignKey:{ key:"id", relation:"test_entity" } }) invalidKey:any notAColumn:string constructor(val?:EProperties<TestEntity>) { super(); this.name=val?.name||"" this.notAColumn=val?.notAColumn||"" this.simpleNumber=val?.simpleNumber||0 this.primaryKeyNull=null; this.invalidKey=null; }}// Register db entity in BaseModule or in the DbConstructorconst db=new CoreDBCon(module)db.registerEntity(new TestEntity()) Copy
// Entity Example@Entity("TestEntity",1) class TestEntity extends CoreEntity{ @Column({ canBeNull:true, dataType:"text" }) name:string|null @Column() simpleNumber:number @Column({ canBeNull:true, }) missingType:any @Column({ canBeNull:true, primaryKey:true }) primaryKeyNull:any @Column({ canBeNull:true, dataType:"float", foreignKey:{ key:"id", relation:"test_entity" } }) invalidKey:any notAColumn:string constructor(val?:EProperties<TestEntity>) { super(); this.name=val?.name||"" this.notAColumn=val?.notAColumn||"" this.simpleNumber=val?.simpleNumber||0 this.primaryKeyNull=null; this.invalidKey=null; }}// Register db entity in BaseModule or in the DbConstructorconst db=new CoreDBCon(module)db.registerEntity(new TestEntity())
Optional
Generated using TypeDoc
Name
CoreEntity