0 Replies Latest reply on Oct 12, 2006 10:04 PM by cecille canonigo

    @DiscriminatorColumn HELP

    cecille canonigo Newbie

      based on the trailblazer example i have applied the @discriminatorcolumn in my customerbean to get the marketname which is in marketbean.

      but i have another countrybean to be mapped to my customerbean in order to get the country. can i have multiple values for my @discriminatorcolumn? or what is the work around? did i declare this right? need your assistance on how to jointables. thanks.

      here is my code snippet:
      @Entity
      @Table(name="Customer")
      @DiscriminatorColumn(name="IDMarket")
      @DiscriminatorValue(value="Market")

      //getting the marketname from marketbean
      @Column(name="IDMarket")
      @OneToOne(optional=false)
      @JoinColumn(name="IDMarket")
      protected MarketBean market;

      public MarketBean getMarket( ) { return market; }
      public void setMarket(MarketBean _market) { market = _market; }


      //getting the countryname from countrybean
      @Column(name="IDCountry")
      @OneToOne(optional=false)
      @JoinColumn(name="IDCountry")
      protected CountryBean country;

      public CountryBean getCountry() { return country; }
      public void setCountry(CountryBean _country) { country = _country; }