jhipster

Spring: Multiple Cache Managers

旧城冷巷雨未停 提交于 2019-12-06 11:29:34
问题 I have a problem implementing a secong cache managers. At the moment I'm using EhCache, which is working fine. Additionally I would like to implement Java Simple Cache. My CacheConfiguration looks like this: CacheConfiguration.java @Configuration @EnableCaching @AutoConfigureAfter(value = { MetricsConfiguration.class }) @AutoConfigureBefore(value = { WebConfigurer.class, DatabaseConfiguration.class }) public class CacheConfiguration { private final javax.cache.configuration.Configuration

Remove hash (#) from URL in Jhipster (both java and angular 6)

孤者浪人 提交于 2019-12-06 11:27:38
问题 I am using Jhipster Spring boot + angular 6. But i'm having trouble because of the hash(#) in URL. It is affecting SEO. I tried setting useHash: false in app-routing-module.ts . But then the API is not working when I run the project via npm start . I think somewhere in Java files I have to change a configuration to remove # from the URL. Here is my WebConfigurer code, @Configuration public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {

Two MySQL Database on Jhipster

我与影子孤独终老i 提交于 2019-12-06 10:06:29
问题 I am using jHipster and it is great as most of the boiler-plate Java code is automatically generated. In my application, I need two MySQL databases. How do I configure them? Should I have two different database config files for the two different schemas? Also, jHipster uses Liquibase, so how do I change my DatabaseConfiguration class? 回答1: You will need to configure 2 datasources, 2 Hibernate sessions, 2 cache instances... This is going to be quite complex: first start with the datasources

Adding new route to Jhipster using Angular 4

为君一笑 提交于 2019-12-06 09:30:52
I'm trying to add a new menu item to the default generated JHipster app. I'm using Angular 4 by the way. The problem I'm facing is that I'm always getting the error below. Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'user-profile' The following are the codes I added. Firstly, I added a folder named user-profile under src/main/webapp/app. In it, I added index.ts, user-profile.component.html, user-profile.component.ts and user-profile.route.ts The contents of index.ts export * from './user-profile.component'; export * from './user-profile.route'; The contents of

How to create entity with a collection-type field in JHipster?

百般思念 提交于 2019-12-06 09:27:56
问题 In our project, we work with a domain model Document . A document may have several titles , so with my JPA knowledge I'd model the Document entity like so: @Entity public class Document { private Set<String> titles; // ... getters and setters } How can I have jHipster generate entities with collection attributes (or, synomymously, collection fields)? 回答1: Depending on jdl document here the collection type for field is not handled yet. I guess you already think of creating an title object and

JHipster: Enable anonymous users to read entity, but not update?

若如初见. 提交于 2019-12-06 07:14:25
I have generated a JHipster application using these values: { "generator-jhipster": { "jhipsterVersion": "3.1.0", "baseName": "app", "packageName": "my.app", "packageFolder": "my/app", "serverPort": "8080", "authenticationType": "session", "hibernateCache": "ehcache", "clusteredHttpSession": "no", "websocket": "no", "databaseType": "sql", "devDatabaseType": "h2Disk", "prodDatabaseType": "mysql", "searchEngine": "elasticsearch", "buildTool": "gradle", "enableSocialSignIn": false, "rememberMeKey": "", "useSass": true, "applicationType": "monolith", "testFrameworks": [], "jhiPrefix": "jhi",

How does maven (running under dev profile) include the javascript files inside index.html?

我只是一个虾纸丫 提交于 2019-12-06 06:54:43
问题 I haven't used jhipster since version 2.0 and I'm currently playing catch-up with version #4.0.6. When I try to build the initial app through "./mvnw" (with default dev maven profile) from the command line, the application javascript files are not added to the index.html (so that page comes up blank in my browser when I try http://localhost:8080). Could someone please explain me the normal chain of events which normally lead maven (running with the dev profile) to include the application

What is correct workaround when updating entities in jhipster?

末鹿安然 提交于 2019-12-06 05:39:38
问题 I have a modelio UML class model. I have been updating it all the time and after that I run jhipster-uml .xmi to regenerate entities. I always ended up to error messages. I tried to delete from -jhipster files the entity.json files but it doesn't help. So could you tell me what is correct workaround to update entities during the development? I tried to run maven:diff task as well, but no luck. EDIT: I created a new jhipster app and created entities from modelio UML class model. Everything is

CORS Origin Spring Boot Jhipster - pre-flight fails

只愿长相守 提交于 2019-12-06 05:28:36
问题 I am using jhipster v2.27.2 I have enabled cors by uncommenting the lines in the application.yml jhipster: async: corePoolSize: 2 maxPoolSize: 50 queueCapacity: 10000 cors: #By default CORS are not enabled. Uncomment to enable. allowed-origins: "*" allowed-methods: GET, PUT, POST, DELETE, OPTIONS allowed-headers: "*" exposed-headers: allow-credentials: true max-age: 1800 In the "WebConfigurer" @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new

Elasticsearch on Jhipster, Spring

喜欢而已 提交于 2019-12-06 05:00:50
Can someone give me example for using Elasticsearch in jHipster or in Spring-boot ? I have already generated entity using jHipster. There are input with placeholder :query ! /** * SEARCH /_search/samples/:query -> search for the sample corresponding * to the query. */ @RequestMapping(value = "/_search/samples/{query}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public List<Sample> search(@PathVariable String query) { return StreamSupport .stream(sampleSearchRepository.search(queryString(query)).spliterator(), false) .collect(Collectors.toList()); } How can