Hello,
I cannot create my table on MS SQL Server 2012.
Here is my class description :
type
[Automapping]
TItemScanne = class(TRecordInfo)
private
procedure SetCodeBarre(const Value: string);
protected
FCodeBarre: string;
public
property CodeBarre: string read FCodeBarre write SetCodeBarre;
end;
[Entity]
[Automapping]
[Id('FId', TIdGenerator.Guid)]
[Table('AB_PALETTES')]
TPalette = class(TItemScanne)
private
[Column('ID_PALETTE'), [TColumnProp.Required]]
FId: TGuid;
[Transient]
FCurrentColis: TColis;
[ManyValuedAssociation([], CascadeTypeAll)]
[ForeignJoinColumn('ID_PALETTE', [TColumnProp.Required])]
FColis: TList<TColis>;
public
constructor Create;
destructor Destroy; override;
function AddColis(Value: string): TColis;
function FindColis(Value: string): TColis;
property colis: TList<TColis> read FColis write FColis;
property CurrentColis: TColis read FCurrentColis write FCurrentColis;
property Id: TGUID read FId;
end;
and here is the generated code :
CREATE TABLE AB_PALETTES (
DATE_CREATION DATETIME NOT NULL,
DEVICE VARCHAR(255) NOT NULL,
UTILISATEUR VARCHAR(255) NOT NULL,
VERSION VARCHAR(255) NOT NULL,
CODE_BARRE VARCHAR(255) NOT NULL,
ID_PALETTE UNIQUEIDENTIFIER NULL,
CONSTRAINT PK_AB_PALETTES PRIMARY KEY (ID_PALETTE))
As you can see :
- Primary Key is marked as NULL
- All other fields are marked as NOT NULL
Shouldn't be the opposite ? Is their a workarround, fixe ?