Einzelnen Beitrag anzeigen

mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.858 Beiträge
 
Delphi 11 Alexandria
 
#2

AW: Kleines Tool: SQL-Table to Class

  Alt 11. Sep 2018, 11:01
Du könntest dir auch mal Marshmallow/Sping4D ansehen.

Dort ist auch ein entsprechendes Tool beinhaltet.

Delphi-Quellcode:
unit ORM.Model.Employee.CUSTOMER;

interface

uses
  Spring.Persistence.Mapping.Attributes,
  Spring.Persistence.Core.Graphics;

type
  [Entity]
  [Table('CUSTOMER', '')]
  TCUSTOMER = class
  private
    FCUST_NO: Integer;
    FCUSTOMER: string;
    FCONTACT_FIRST: string;
    FCONTACT_LAST: string;
    FPHONE_NO: string;
    FADDRESS_LINE1: string;
    FADDRESS_LINE2: string;
    FCITY: string;
    FSTATE_PROVINCE: string;
    FCOUNTRY: string;
    FPOSTAL_CODE: string;
    FON_HOLD: string;
  public
    [Column('CUST_NO',[cpRequired,cpPrimaryKey,cpNotNull],10,0)]
    property CUST_NO: Integer read FCUST_NO write FCUST_NO;
    [Column('CUSTOMER',[cpRequired,cpNotNull],25)]
    property CUSTOMER: string read FCUSTOMER write FCUSTOMER;
    [Column('CONTACT_FIRST',[],15)]
    property CONTACT_FIRST: string read FCONTACT_FIRST write FCONTACT_FIRST;
    [Column('CONTACT_LAST',[],20)]
    property CONTACT_LAST: string read FCONTACT_LAST write FCONTACT_LAST;
    [Column('PHONE_NO',[],20)]
    property PHONE_NO: string read FPHONE_NO write FPHONE_NO;
    [Column('ADDRESS_LINE1',[],30)]
    property ADDRESS_LINE1: string read FADDRESS_LINE1 write FADDRESS_LINE1;
    [Column('ADDRESS_LINE2',[],30)]
    property ADDRESS_LINE2: string read FADDRESS_LINE2 write FADDRESS_LINE2;
    [Column('CITY',[],25)]
    property CITY: string read FCITY write FCITY;
    [Column('STATE_PROVINCE',[],15)]
    property STATE_PROVINCE: string read FSTATE_PROVINCE write FSTATE_PROVINCE;
    [Column('COUNTRY',[],15)]
    property COUNTRY: string read FCOUNTRY write FCOUNTRY;
    [Column('POSTAL_CODE',[],12)]
    property POSTAL_CODE: string read FPOSTAL_CODE write FPOSTAL_CODE;
    [Column('ON_HOLD',[],1)]
    property ON_HOLD: string read FON_HOLD write FON_HOLD;
  end;

implementation


end.
Miniaturansicht angehängter Grafiken
codeentityeditor01.jpg  
Markus Kinzler
  Mit Zitat antworten Zitat