import { Entity, Columns, Id, ColumnType } from '@ohos/dataorm';

// 表名需与sqlite一致
@Entity('t_huanzhelast444')
export class Huanzhelast444Model {
  @Id()
  @Columns({ columnName: '_id', types: ColumnType.num }) // 主键字段映射
  _id: number = 0;

  @Columns({ columnName: 'id', types: ColumnType.num })
  id: number = 0;

  @Columns({ columnName: 'fullname', types: ColumnType.str })
  fullname: string = '';

  @Columns({ columnName: 'name', types: ColumnType.str })
  name: string = '';

  @Columns({ columnName: 'parent', types: ColumnType.num })
  parent: number = 0;

  @Columns({ columnName: 'treePath', types: ColumnType.str })
  treePath: string = '';

  // 必须包含所有非静态变量的构造函数
  constructor(
    _id: number = 0,
    id: number = 0,
    fullname: string = '',
    name: string = '',
    parent: number = 0,
    treePath: string = ''
  ) {
    this._id = _id;
    this.id = id;
    this.fullname = fullname;
    this.name = name;
    this.parent = parent;
    this.treePath = treePath;
  }

  setTreePath(treePath:string) {
    this.treePath = treePath;
  }

  getTreePath():string {
    return this.treePath;
  }

  setParent(parent:number) {
    this.parent = parent;
  }

  getParent():number {
    return this.parent;
  }

  setName(name:string) {
    this.name = name;
  }

  getName():string {
    return this.name;
  }

  setFullname(fullname:string) {
    this.fullname = fullname;
  }

  getFullname():string {
    return this.fullname;
  }

  getId():number {
    return this.id;
  }

  setId(id:number) {
    this.id = id;
  }

}