2

マシュマロ用の既存のモデルジェネレーター(スプリングパーシステンス)があるかどうかは誰にもわかりません。すべてのクラスや外部キーなどを手で書くのはそれほど便利ではありません。

前もって感謝します。

type
  [Entity]
  [Table('Products')]
  TProduct = class
  private
    [Column('PRODID', [cpRequired, cpPrimaryKey, cpNotNull, cpDontInsert], 0, 0, 0, 'Primary Key')]
    [AutoGenerated]
    FId: Integer;
  private
    FName: string;
    FPrice: Currency;
    FQuantity: Integer;
    fCreationDate: TDate;
    fCreationDateTime: TDateTime;
    fCreationTime: TTime;
  public
    property ID: Integer read FId;
    [Column('PRODNAME', [], 50, 0, 0, 'Product name')]
    property Name: string read FName write FName;
    [Column('PRODPRICE', [], 0, 0, 0, 'Product price')]
    property Price: Currency read FPrice write FPrice;
    [Column('PRODQUANTITY')]
    property Quantity: Integer read FQuantity write FQuantity;
    [Column('PRODCREATIONDATE')]
    property CreationDate: TDate read fCreationDate write fCreationDate;
    [Column('PRODCREATIONDATETIME')]
    property CreationDateTime: TDateTime read fCreationDateTime write fCreationDateTime;
    [Column('PRODCREATIONTIME')]
    property CreationTime: TTime read fCreationTime write fCreationTime;
  end;

ジェネレーターがDB内のテーブルのpasファイルを生成するようにします。

4

0 に答える 0