4 Replies Latest reply on Apr 9, 2009 2:22 PM by ahmadadly

    Seam-gen problem with 2 foriegn keys for the same table

    ahmadadly
      Hi all,
      I am newbie with jBoss Seam. I have a problem with Seam-gen when developing exchange sample. I have 2 tables in my database, currency table [code, name, symbol, rate] and transaction_history table [id, currency_from, currency_to, transaction_date, amount].

      currency_from is a foreign key for Currency entity, that user want to convert an amount from this currency

      currency_to is a foreign key for Currency entity, that user want to convert an amount to this currency

      when I ran seam-gen tool to generate entities I got 2 instances in TransactionHistoryHome class with 2 fields like:

           @In(create = true)
           CurrencyHome currencyHome;
           @In(create = true)
           CurrencyHome currencyHome;

      as you can see, these 2 instances should reflect the foreign key relations between TransactionHistory and Currency entities. I think seam-gen has a bug with generating entities from database.

      I will appreciate any help in advance