1 2 Previous Next 16 Replies Latest reply: Apr 3, 2012 2:04 AM by ruckan Go to original post RSS
      • 15. Re: Rename foreign key constraint
        Philip Stoyanov-Oracle
        fkeys = model.getFKIndexAssociationSet().toArray();
        for (var i = 0; i<fkeys.length;i++){
         fk = fkeys;
        //also can use fk.getTable().getAbbreviation()
        fkname = "FK_"+fk.getTable().getName();
        cols = fk.getColumns();
        for( var k = 0;k<cols.length;k++){
        //also can use cols[k].getAbbreviation()
        fkname = fkname + "_" + cols[k].getName();
        }
        fk.setName(fkname);
        fk.setDirty(true);
        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
        • 16. Re: Rename foreign key constraint
          ruckan
          Great. This is what I was looking for.

          Thanks.
          1 2 Previous Next