Add elasticsearch option when mongo is selected#6595
Add elasticsearch option when mongo is selected#6595jdubois merged 10 commits intojhipster:masterfrom
Conversation
91d4682 to
3590eaa
Compare
|
Congrats @ramzimaalej ! |
|
Yes, awesome! |
| } | ||
| } if (databaseType === 'mongodb') { _%> | ||
| @Document(collection = "<%= entityTableName %>") | ||
| @org.springframework.data.mongodb.core.mapping.Document(collection = "<%= entityTableName %>") |
There was a problem hiding this comment.
To make it less ugly when using mongo without ES I suggest to create an intance variable called mongoDocumentAnnotation and use it here the value of which can be qualified path when using ES and just document when using without ES. The same gies for ES annotation and the imports
There was a problem hiding this comment.
sure, I will take care of it
| @Table(name = "<%= entityInstance %>") | ||
| <%_ } if (searchEngine === 'elasticsearch') { _%> | ||
| <%_ } if (searchEngine === 'elasticsearch' && databaseType === 'mongodb') { _%> | ||
| @org.springframework.data.elasticsearch.annotations.Document(indexName = "<%= entityInstance.toLowerCase() %>") |
There was a problem hiding this comment.
While this is correct my idea was to simplify this with a variable. Dont worry ill do it while merging. Ill merge th 8000 is later
There was a problem hiding this comment.
I think this way offers better readability of what's going in the template unless you want to put the logic here, but it's up to you. I don't have a strong opinion about it.
|
Please check the test failure for new setup |
ef6e343 to
b0259e5
Compare
b0259e5 to
6d269e2
Compare
|
Intellij was misleading me, the issue has nothing to do with Mapstruct. Actually, it's because of the ZonedDateTime converter. `public static class DateToZonedDateTimeConverter implements Converter<Date, ZonedDateTime> { while technically speaking the generated object represent the same timestamp, they are slightly different causing this line to fail
I have changed to use string instead of data and it works like a charm `public static class StringToZonedDateTimeConverter implements Converter<String, ZonedDateTime> { I raised a PR on jhipster core: jhipster/jhipster#31 |
|
The issue I see is that ES stores |
|
If we use long we will also lose the timezone, because when you create a |
|
Most of our DBs (currently all of them except cassandra) don't preserve the timezone and the view layer will remove it anyway so it's not a big deal to lose it. |
6d269e2 to
a2ba799
Compare
|
done. let me know if there is anything else to address in this PR. |
|
I just need time to review but this looks quick to do |
|
LGTM
So I don't know if this PR needs to be merged jhipster/jhipster#31 |
|
@pascalgrimaud I think we can discard it for now (jhipster/jhipster#31). |
4d4457c to
d75a61d
Compare
|
@pascalgrimaud can you please restart the build. |
|
it's green, so it's ok ? |
|
Yeap. Once merged I will work on adding elasticsearch to couchbase as well. |
|
@ramzimaalej not before the next release, where we modified our build system (with jhipster/jhipster-dependencies) and added Couchbase support. This is already a huge release, and we need some time to iron it out. |
There was a problem hiding this comment.
This needs to be rebased as the entity templates are moved to entity-client and entity-server folders
d75a61d to
e8f2b06
Compare
|
@deepu105 done |
|
@ramzimaalej : just for your information, as soon as it's merged, I will probably move your Travis tests to https://github.com/hipster-labs/jhipster-travis-build because I'm not sure MongoDB + Elasticsearch will be used a lot. And I will add MongoDB + Elasticsearch + Gradle tests too. I don't request change here as you already work a lot on this. |
|
no prob @pascalgrimaud Let me know if you need help. |
|
LGTM and @deepu105 your changes were corrected, so let's merge this. |
This is a first attempt to fix this issue #1810
@jdubois @deepu105 Let me know if you have any feedback on this. I also would like to add tests to this and solve this non-blocking issue:
org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [file:/Users/rmaalej/Documents/dev/workspace/expensy/expensy-analytics/build/classes/scala/main] either use fromURL(final URL url, final List<UrlType> urlTypes) or use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType. at org.reflections.vfs.Vfs.fromURL(Vfs.java:109) at org.reflections.vfs.Vfs.fromURL(Vfs.java:91)