0 Replies Latest reply on Jul 30, 2007 7:07 AM by kavi arasu

    Inserting into secondry table

    kavi arasu Newbie

      hi
      i want to insert values in primary and secondry table using JSF
      im using one to many annotation to combine primary and secondry table
      the secondry table is mapped as set
      can any one tell how to inseert values in secondry table from jsf
      i have pasted the coding below, the REVIEW_ENTRY_ID is primary key.
      i have written trigger to insert review enteryId in secondry table when it is entered in primary, i want to insert reviewHeading in secondry table,

      primary table

      @Name("write")
      @Id
       @Column(name="REVIEW_ENTRY_ID")
       private BigDecimal reviewEntryId;
      @OneToMany(mappedBy="reviewEntryId")
       private Set<TblUserReviews> tblUserReviewsCollection;


      secondry table

      @Column(name="REVIEW_HEADING")
       private String reviewHeading;
      @ManyToOne
       @JoinColumn(name="REVIEW_ENTRY_ID")
       private TblReviews reviewEntryId;


      JSF

      <table border="0" style=" width : 771px;">
       <tr>
       <td>Rate the product</td>
       <td><rich:inputNumberSlider value="#{write.reviewEntryId}"/>
       </td>
       <td>
       </td>
       </tr>
       <tr style=" height : 6px;">
       <td>Review Title</td>
       <td><h:inputTextarea value="#{write.reviewHeading}" style=" width : 445px; height : 34px;"></h:inputTextarea>
       </td>
       </tr>
       </table>



      Thank you
      regards
      Kaviarasu