Segue exemplo do que preciso:
[Entity]
[Inheritance(TInheritanceStrategy.SingleTable)]
[Sequence('GEN_PRODUTO_ID')]
[Id('Chave', TIdGenerator.None)]
[Table('PRODUTO')]
TProdutoMin = class
private
FChave: integer;
FAtivo : Integer;
FProdutoEstoque : TList<TProdutoEstoque>;
public
[Column('CHAVE')]
property Chave: integer read FChave write FChave;
[Column('ATIVO')]
property Ativo: integer read FAtivo write FAtivo;
[Column('CHAVEEMPRESA')]
[ManyValuedAssociation([], CascadeTypeAll)]
[ForeignJoinColumn('CHAVEPRODUTO')]
property ProdutoEstoque: TList<TProdutoEstoque> read FProdutoEstoque write FProdutoEstoque;
type
[Entity]
[Sequence('GEN_PRODUTOESTOQUE_ID')]
[Id('Chave', TIdGenerator.none)]
[Table('PRODUTOESTOQUE')]
TProdutoEstoque = class
private
FChave: integer;
FAtivo : Integer;
FChaveEmpresa : Integer;
FSaldo : Currency;
FData: Nullable<TDate>;
FDataHoraAlt: Nullable<TDateTime>;
FChaveProduto: Integer;
FSaldoReservado: Currency;
public
[Column('CHAVE')]
property Chave: Integer read FChave write FChave;
[Column('ATIVO')]
property Ativo: Integer read FAtivo write FAtivo;
[Column('CHAVEEMPRESA')]
property ChaveEmpresa: Integer read FChaveEmpresa write FChaveEmpresa;
[Column('SALDO')]
property Saldo: Currency read FSaldo write FSaldo;
[Column('DATA')]
property Data: Nullable<TDate> read FData write FData;
[Column('DATAHORAALT')]
property DataHoraAlt: Nullable<TDateTime> read FDataHoraAlt write FDataHoraAlt;
[Column('SALDORESERVADO')]
property SaldoReservado: Currency read FSaldoReservado write FSaldoReservado;
end;
type
[Entity]
TProdutoEstoqueComChaveprod=class(TProdutoEstoque)
private
FChaveProduto: Integer;
public
[Column('CHAVEPRODUTO')]
property ChaveProduto: Integer read FChaveProduto write FChaveProduto;
end;
Ao criar o bd gera exceção de duplicate column. Pois eu tenho a chaveproduto da classe tprodutodptoestoque como chave estrangeira em tprodutomin e tenho ela e e tenho ela na classe TProdutoEstoqueComChaveprod.
Eu utilizo a classe TProdutoEstoqueComChaveprod para dar um insert com sql puro. Ou seja eu seto dados atraves desse objeto. mas preciso que a tabela tenha ligação com TProdutoMin para manipulação.
Como faco para nao dar essa exceção ? Teria que ignorar o mapeamento para TProdutoEstoqueComChaveprod mas não consigo.