You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is the properties userId and activityId collide during code generation with userId and activityId properties generated for the relationships user and activity
And you get the error Cannot use the default constructor of 'ActivityRatingEntity': don't know how to initialize param userId - no such property. which is misleading
Here is the generated structure without my userId and activityId properties
Is there an existing issue?
Use case
I'm trying to create an entity like this:
The problem is the properties
userId
andactivityId
collide during code generation withuserId
andactivityId
properties generated for the relationshipsuser
andactivity
And you get the error
Cannot use the default constructor of 'ActivityRatingEntity': don't know how to initialize param userId - no such property.
which is misleadingHere is the generated structure without my
userId
andactivityId
propertiesHere is the structure without the relations
Proposed solution
Add documentation to avoid creating properties like
<relation name>Id
Change the error message to something more useful (maybe first add a mechanism/condition to detect the collisions)
Describe alternatives you've considered
Renaming the relationships or attributes is the obvious solution
Still, should be documented and the error message should be more useful
Additional context
I speak Spanish, English is my second language, and i see no way that error message pointing me the right direction, maybe i understand it wrong.
The text was updated successfully, but these errors were encountered: