Closed ernsyn closed 7 months ago
Update:
I added another step to Method 1 by running the following command.
"jhipster --tenant-name Company"
After that, I proceeded to add a Book entity that is Tenant Aware. There was a bug in the generation where an extra comma is added in the entity.module.ts and once that extra comma is removed, it builds fine.
However, I noticed 2 things.
Is this expected?
Looking forward to your reply
Welcome to the JHipster Information Sub-Generator
tenantview@0.0.1-SNAPSHOT /Users/john/workspace/oss/jhipster-based/tenantview
└── generator-jhipster@6.9.0
.yo-rc.json
file generated in the root folder{ "generator-jhipster": { "promptValues": { "packageName": "com.tviewtest" }, "jhipsterVersion": "6.9.0", "applicationType": "monolith", "baseName": "tenantview", "packageName": "com.tviewtest", "packageFolder": "com/tviewtest", "serverPort": "8080", "authenticationType": "jwt", "cacheProvider": "ehcache", "enableHibernateCache": true, "websocket": false, "databaseType": "sql", "devDatabaseType": "h2Disk", "prodDatabaseType": "mysql", "searchEngine": false, "messageBroker": false, "serviceDiscoveryType": false, "buildTool": "maven", "enableSwaggerCodegen": false, "jwtSecretKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons", "embeddableLaunchScript": false, "useSass": true, "clientPackageManager": "npm", "clientFramework": "angularX", "clientTheme": "none", "clientThemeVariant": "", "creationTimestamp": 1594716691827, "testFrameworks": [], "jhiPrefix": "jhi", "entitySuffix": "", "dtoSuffix": "DTO", "otherModules": [ { "name": "generator-jhipster-tenantview", "version": "1.0.0" } ], "enableTranslation": false, "blueprints": [ { "name": "generator-jhipster-tenantview", "version": "1.0.0" } ], "lastLiquibaseTimestamp": 1594717132000 }, "generator-jhipster-tenantview": { "tenantName": "Company", "tenantModule": "admin", "tenantModelPath": "shared/admin" } }
entityName.json
files generated in the .jhipster
directoryentity Company { name String required minlength(3), idName String minlength(3) } entity Book { title String } relationship ManyToOne { Book{company(name) required} to Company } service Company, Book with serviceClass clientRootFolder Company with ../admin paginate Book with pagination
java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
git version 2.21.0 (Apple Git-120)
node: v12.18.2
npm: 6.14.5
yeoman: 3.1.0
yarn: 1.13.0
Docker version 19.03.8, build afacb8b
docker-compose version 1.25.4, build 8d51620a
identical .jhipster/Book.json identical .jhipster/Company.json INFO! Congratulations, JHipster execution is complete!
@mshima
Any advise regarding my issue above?
I recommend to use required branch. And use jdl some samples at https://github.com/mshima/generator-jhipster-tenantview/tree/required/test-integration/samples. Due to jhipster6 workflow kind of broken, I decided to focus at jdl.
Can you share which required branch? I used the last release version but didn't work.
Also, my steps above is correct right?
npm install -g mshima/generator-jhipster-tenantview#required
Use jdl eg:
jhipster jdl https://github.com/mshima/generator-jhipster-tenantview/blob/required/test-integration/samples/jdl-owner/app.jdl
I tried your suggestion but the AOP classes weren't generated. Does it require specific version of JHipster?
Forgot —blueprints tenantview
JHipster latest version
I tried as per your suggestion above. The project now generates with the tenant (Owner entity & Owner Aspect). However it did not generate any AOP class for BankAccount. Based on the jdl snippet below, I assume the BankAccount entity is supposed to have the filter definitions and also a corresponding AOP class generated for it?
@tenantAware entity BankAccount { name String required bankNumber Integer agencyNumber Long lastOperationDuration Float meanOperationDuration Double balance BigDecimal required openingDay LocalDate lastOperationDate Instant active Boolean accountType BankAccountType attachment AnyBlob description TextBlob }
In my generated project, I did not see any filters or AOP class for the BankAccount entity.
Hi,
I'm trying to test this blueprint out but regardless of whichever method I try, it still fail to generate properly. What I've tried so far.
Method 1.
Method 2.
At this point, I'm stuck. Appreciate if you can advise the steps required to generate a functioning multi tenant application with this blueprint.
Note: I'm using JHipster v6.9.0