有没有人知道Marshmallow是否存在现有的模型生成器(弹簧持久性)。手工编写所有类和外键等并不是那么方便。
提前谢谢。
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文件。