0

i have this table :

CREATE TABLE `documents_revisions` (
  `es_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `seq_head` int(10) unsigned NOT NULL,
  `member_id` int(10) unsigned NOT NULL,
  `file_id` varchar(512) COLLATE utf8_unicode_ci NOT NULL,
  `save_hash` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  UNIQUE KEY `documents_rev_eis_idx` (`es_id`,`seq_head`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

When i apply reverse eng grails plugin grails db-reverse-engineer , i get this error :

Method public java.lang.String grails.plugin.reveng.GrailsEntityPOJOClass.renderConstraints() threw an exception when invoked on Entity: abdennour.DocumentsRevisions

However , there is no pb with the others Db tables . Indeed , Reverse engineering works fine with those tables.

Thus , i note that this plugin have a problem with compound key .

Please , Note that is a composite UNIQUE key it is not a composite PRIMARY key

Community
  • 1
  • 1
Abdennour TOUMI
  • 87,526
  • 38
  • 249
  • 254

1 Answers1

1

This is a bug in the plugin - it assumes that all tables have a primary key and fails when the object representing that in the model is null. I released version 0.5.1 of the plugin with a fix for this.

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
  • where could us find this new version – Abdennour TOUMI Nov 05 '14 at 10:54
  • It's available in the same repo as all of the other plugins. Edit the dependency line in `BuildConfig.groovy` and change `0.5` to `0.5.1`. Run `grails compile` and that will trigger a dependency check, and it will remove the old version and install the new one. – Burt Beckwith Nov 05 '14 at 13:19
  • Don't forget to mention to my name in your new version . Of course , if i am the trigger of this issue – Abdennour TOUMI Nov 05 '14 at 15:09
  • 1
    The JIRA server was down for a couple of days but I reported the issue: https://jira.grails.org/browse/GPREVERSEENGINEER-30 – Burt Beckwith Nov 09 '14 at 01:33
  • لا عليك . لا بأس . فقد تم تنزيل الكود الذي طورته بنجاح . و شكرا جزيلا مرة أخرى – Abdennour TOUMI Nov 09 '14 at 08:40