Tagged: spring database scaffolding
October 7, 2016 at 9:54 am #499253
following the problem I explained here (tl;dr : a full rescaffolding for me takes hours) I was wondering: how can I avoid doing a full rescaffold when all I want to do is update the generated code just for the tables I changed/added?
I’ll make an example: I have table “elements”, “elementdetails”, “otherelementdetails”; the latter 2 tables have a foreign key reference to the primary key of “elements”. I scaffolded from this DB model and all is fine and dandy.
Now suppose I add some attributes to “elementdetails” and want to rescaffold. I can do a full rescaffold using all tables, which will work but as I said for me takes hours (my model has 90+ tables…).
If instead I do a rescaffold selecting only the “elementdetails” table, the rescaffold is much quicker but I end up with domain classes that are missing the reference to the “elements” table.
I could select both “elements” and “elementdetails”, but if the criterion is having to select the table I want to rescaffold together with all the tables referenced, and if this has to be done recursively, this pretty much amounts (in my case) to doing a full rescaffold, because “elements” is the central concept in my model and about all tables reference it directly or indirectly.
So, is there a notion of “rescaffold just the table I modified” that will keep correct relationships, or am I better off just changing the java and SpringDSL code by hand when the modifications are small?
MyEclipse Enterprise Workbench
Version: 2016 CI 7
Build id: 14.0.0-20160923
DB: MySQL 5.5
October 11, 2016 at 1:58 am #499486
- This topic was modified 2 years, 3 months ago by Luis Pedro.
Sorry for the delay; we’ve been looking into this. I’m afraid that there is no incremental capability as such. You can select tables to be scaffolded (on the Select Database Tables page of the scaffolding dialog) but if those tables have foreign keys to tables that haven’t been selected, it’s likely that the appropriate links won’t be created.
I’ve asked development to look at this further and, if they have more suggestions, we’ll add a reply here. In the meantime, could you give details of how you are scaffolding (which options you are selecting in the dialog) as this may help guide suggestions?
Sorry for the inconvenience.October 11, 2016 at 4:39 am #499497
a screenshot of the options I select is here:
these are screenshots for when I select all tables, but you get the idea. To use our example above, it would be cool if I could do something like the following:
– choose both “elements” and “elementdetails” for scaffolding;
– check some option for the elements table that says “assume this is already generated – don’t redo it”
– then it would only scaffold “elementdetails”, and only generate stuff on its side; it would be my responsibility to make sure that “elements” is still the same table as it was in the previous scaffolding.