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

    Inserting value in primary and secondry table

    kavi arasu Newbie

      Hi
      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


      @Name("user3")
      @Table(name = "TBL_REVIEWS")
      
      @SecondaryTable(name="TBL_USER_REVIEWS", pkJoinColumns={ @PrimaryKeyJoinColumn(name="REVIEW_ENTRY_ID")})
      
      
      public class TblWriteReviews implements Serializable {
       @Id
       @GeneratedValue(generator="IdSeq")
       @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
      kavi