sonalake / generator-jhipster-multitenancy

A JHipster blueprint for creating multitenant applications
84 stars 29 forks source link

Create entity relationship with tenant #54

Closed tikaa closed 5 years ago

tikaa commented 5 years ago

JHipster v5.2.1 Java 8

Hello I want to create a relationship to a table with the tenant table. this is my jdl change to create the relationship,

`entity Package { userLimit String required, //string because it has to store unlimited as a parameter packageName String required }

relationship ManyToOne { Tenant to Package{tenant} }`

but this fails with error

Executing jhipster:import-jdl Asbastos.jdl Options: The JDL is being parsed. Error: Valid source and destination entities are required. ERROR! ERROR! Error while parsing applications and entities from the JDL Error: Valid source and destination entities are required. Error: ERROR! Error while parsing applications and entities from the JDL Error: Valid source and destination entities are required.

I have seen that it is not possible to create database relationships with default jhipster tables such as jhi_user, and the solution given is to create a table and change back-end methods to save data to the created table on changing/creating users. Do we have to use the same method to create relationships with the tenant table too?

Thanks!

jduggan83 commented 5 years ago

Hi @tikaa Apologies for the delay in getting back to you on this. To create a relationship to your tenant table you need use the name you have given to your tenant. The default value when running the module is company. Thanks