4 Replies Latest reply on Mar 21, 2011 4:45 PM by Luiz Soares

    Update a table and then insert in another table

    Luiz Soares Newbie

      I have a situation that when I include an object I first have to update this Sequence table (that controls the sequences) and then include the object in his proper table.
      I want to know how I do this. I'm thinking in overriding the persist method and then do it there, but what do I use?

      To make things more clear, an example:

      Let's say I'm trying to include an object in the Control Table. This table has a sequence that is his PK.
      I have another table called SEQ table that controls all the sequences of the database. This table has 2 fields, one called TABLENAME and other called LASTVALUE.

      So, to include the object in the Control table I have to update the field that references the Control table in the SEQ table and then insert the new object in the Control table.

      What can I use to do this query?

      Thanks for your help!