telosystools

Open full view…

Exclude models from code generation

msuret
Mon, 21 Oct 2019 17:10:54 GMT

Hi, I have a many-to-many relationship between two tables (e.g. _car_ and _driver_) linked by a pivot table (e.g. _car-driver-mapping_). DB model generation successfuly produces 3 models (_Car_, _Driver_ And _CarDriverMapping_). I would like to generate code only for _Car_ and _Driver_. How can I do that with the CLI ? Something like `gen Car,Driver *` doesn't work because the entity _CarDriverMapping_ contains both these words and I can't imagine how to name it without them. I don't want to exclude it from model generation either because that would remove the link between other models. Thanks!

Telosys Team
Mon, 28 Oct 2019 14:06:56 GMT

Hi, at the moment there's no way to explicitly exclude an entity when the generation is launched. But a workaround can be to change the entity name in the model file. For example rename "CarDriverMapping" to "ManyToManyCD" or "CDMapping" To do that, just open the ".dbmodel" file with a text editor and replace all the occurrences of "CarDriverMapping" : - <table javaBean="xxx" > - <link targetEntity="xxx" />