-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplication of models when generating code #26
Comments
Hi @wborowiecki - you will need to have two different models as they are not always guaranteed to be the same, as different columns (with different names) could be selected resulting in different set of properties. From a publishing perspective they will result in same JSON assuming same columns with same names. Let me know if there are any issues related to the use of the two models. |
@chullybun please consider a scenario in which table "Order" has references to table "User" twice: "CreatedById" and "UpdatedById". It would be desired to have a single model for User that is referenced twice. |
Yeah ok, that makes sense. But developers will need to be cognizant that the definition must be the same. Looking forward to your pull request. |
thank you for accepting the pull request, let me close it |
In my master table, I have 2 columns that point to the same column, two times 1:1
I defined join as:
{name: RecentPOC, table: NAC_Contacts, joinCardinality: OneToOne, model: Contact, property: RecentPOC, joinTo: NAC_Vendors,
on: [
{name: CN_ContactID, toColumn: VE_RecentPOCID}
]
},
{name: BookingContact, table: NAC_Contacts, joinCardinality: OneToOne, model: Contact, property: BookingContact, joinTo: NAC_Vendors,
on: [
{name: CN_ContactID, toColumn: VE_BookingContactID}
]
}
Model "Contact" will be generated twice and the code will not compile.
The text was updated successfully, but these errors were encountered: