0 Replies Latest reply on Jul 17, 2007 6:37 AM by kavi arasu

    Inserting values in primary and secondry tables

    kavi arasu Newbie

      i have two tables one have primary key and the secondry table has foreign key.
      i generate a autoId increment which want to inserted in primary and secondary table when the user enters the register button
      hw to do the exercise
      can any one give the solution

      @Table(name = "TBL_REVIEWS")
      @SecondaryTable(name="TBL_USER_REVIEWS", pkJoinColumns={ @PrimaryKeyJoinColumn(name="REVIEW_ENTRY_ID")})
      public class TblWriteReviews implements Serializable {
       @SequenceGenerator(name="IdSeq",sequenceName="REVIEW_ENTRY_ID_SEQ", allocationSize=1)
       @Column(name = "REVIEW_ENTRY_ID")

      where the reviewEntryId is auto generated and want to be entered when the register button is entered .TBL_USER is primary table TBL_USER_REVIEWS is secondry table
      can any one help me
      thank u regards