Cannot build database from classes

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 ?

Here is the base class


type
  [Automapping]
  TRecordInfo = class(TPersistent)
  private
    procedure SetDefaultValues;
  protected
    FDateCreation: TDatetime;
    FDevice: string;
    FUtilisateur: string;
    FVersion: string;
  public
    constructor Create; overload;
    property DateCreation: TDatetime read FDateCreation write FDateCreation;
    property Device: string read FDevice write FDevice;
    property Utilisateur: string read FUtilisateur write FUtilisateur;
    property Version: string read FVersion write FVersion;
  end;


Please see the other topic, you can't use mapping in non-entity classes.

Landgraf,

I'm sorry but this has nothing to do with non entity classes.
TRecordInfo and TItemScanne are now entity class.

I still have this error. I guess (this is only my humble opinion) that Aurelius doesn't correctly set fields properties as an UNIQUE field must be "NOT NULL" (and not "NULL")

Then please provide the complete and current mapping so we can test and debug it here. 

Also note that if you have an class hierarchy system you must explicitly define the inheritance mode using [Inheritance] attribute and eventually [PrimaryJoinColumn] or [DiscriminatorColumn], [DiscriminatorValue].


See http://www.tmssoftware.biz/business/aurelius/doc/web/inheritance.htm

I have already sent a project to support. Please check your mail.
I've tried to follow the documentation, so some of my questions may be irrelevant.