Prevent generating @FK attributes

32 Views Asked by At

How can I prevent @FK attributes from not being created when generating the model?

Since the primary keys are not defined, but only constraints, the files cannot be generated later.

[ERROR] : Invalid model 'TestModel' Converter error : Entity tContact: tOwnerid : FK error : 'titemid' is not a ID/PK attribute in entity 'tAccount' Cannot load model => stopping code generation.

The following is already defined in databases.yaml:

  • linksOneToMany: false
  • linksManyToOne: false
  • linksManyToMany: false

I use Telosys V 4.1.0-001.

1

There are 1 best solutions below

0
lgu On

In the current Telosys version it's not possible to prevent FK definitions when the model is automatically created from a database.
But the mentionned error is triggered when the model is loaded.

So, for now (as a workaround) you can manually edit the entities (".entity" files) that contains invalid FK and remove "@FK" annotation.