Recursive association and PostgreSQL

Hello,


I'm trying to create an entity the contains a recursive association but I'm getting an error when executing UpdateDatabase().
Here is the detail of my stack :

PostgreSQL 9.3
Delphi XE6
FireDAC

Here is my Entity class : 



  [Entity]
  [Automapping]
  TDBState = class
  Private
    FId : Integer;
    FName : String;
    FShortName : String;
    FIsProductive : Boolean;
    FIsUsed : Boolean;
    FIsTerminative : Boolean;
    FDisplayOrder : Integer;
    FIntColor : Integer;


    [Transient]
    FColor : TColor;


    [Association]
    [JoinColumn]
    FParentState : TDBState;
  Published
    Property id : Integer read FId write Fid;
    property intColor: Integer read FIntColor write FIntColor;
    Property name : String read FName write FName;
    Property shortName : String read FShortName write FShortName;
    Property isProductive : Boolean read FIsProductive write FIsProductive;
    Property isUsed : Boolean read FIsUsed write FIsUsed;
    Property isTerminative : Boolean read FIsTerminative write FIsTerminative;
    Property displayOrder : Integer read FDisplayOrder write FDisplayOrder;
    Property parent : TDBState read FParentState write FParentState;
end;


Here is the logged SQL statement received by PGSQL server :

2014-09-17 16:13:32 CEST INSTRUCTION :  CREATE TABLE DBSTATE (	  ID INTEGER NOT NULL,	  NAME VARCHAR(255) NOT NULL,	  SHORT_NAME VARCHAR(255) NOT NULL,	  IS_PRODUCTIVE BOOLEAN NOT NULL,	  IS_USED BOOLEAN NOT NULL,	  IS_TERMINATIVE BOOLEAN NOT NULL,	  DISPLAY_ORDER INTEGER NOT NULL,	  INT_COLOR INTEGER NOT NULL,	   INTEGER,	  CONSTRAINT PK_DBSTATE PRIMARY KEY (ID));


Obviously there is something wrong with the PARENT field.

Did I do something wrong in my Aurelius attributes declaration?

Thanks

Either specify the name of the foreign key field in JoinColumn, or don't use it, since you are using [automapping] Aurelius will create a name for it automatically

That works perfectly thanks.