0 Replies Latest reply on Nov 30, 2012 2:25 PM by Pol P

    GenerationType.IDENTITY, generator  for table generated values

    Pol P Newbie

      I have the following in my Entity class

       
      @Id @GeneratedValue(strategy= GenerationType.IDENTITY)


       

      And in order to populate my primary key in my Oracle  database I have a trigger like the following

       

      CREATE OR REPLACE TRIGGER DOCUMENTS_BI
         BEFORE INSERT
         ON documents
         FOR EACH ROW
      DECLARE
      BEGIN
         SELECT NVL (MAX (doc_id), 0) + 1 INTO :NEW.doc_id FROM documents;
      END;
      /

       

       

      As per this disussion(https://community.jboss.org/thread/188775)

      GenerationType.IDENTITY, generator = "system-uuid") 
      

      can be used.

       

      As I do not have any sequence or rawtohex(sys_guid()), what is value to provided for generator =

       

      Any help is highly appreciated.

       

      Thanks