In my project https://github.com/thomas-meyer-57647/Hurricane
I have encountered a few problems for which I have not found any solutions.
- @Indexd(unique=true) I use in my model in different places e.g. https://github.com/thomas-meyer-57647/Hurricane/blob/main/Hurricane/src/main/java/com/tmt/hurricane/user/model/User.java @Indexd(unique=true) this seems not to work.
For this reason, I am currently forced in the associated service class https://github.com/thomas-meyer-57647/Hurricane/blob/main/Hurricane/src/main/java/com/tmt/hurricane/user/service/UserService.java in the function public User createUser(User creator, User user) use the following line alternative
if ( existsUserByEmail(user.getEmail()) ) throw new DuplicateException("UserService::createUser(" + creator + ", " + user + "): EMail (" + user.getEmail() + ") allready exists");
to use
2 . mongoOperations.exists(query, User.class) The function mongoOperations.exists(query, User.class) of von https://github.com/thomas-meyer-57647/Hurricane/blob/main/Hurricane/src/main/java/com/tmt/hurricane/user/service/UserService.java does not seem to work correctly, because e.g. the associated test UserServiceTest.java https://github.com/thomas-meyer-57647/Hurricane/tree/main/Hurricane/src/test/java/com/tmt/hurricane/user/service in the function testExistsUserByEmail() at line 1326 it fails, instead of true, because the above mongoOperations.exists(query, User.class) returns false instead of true.
In the class CountryService https://github.com/thomas-meyer-57647/Hurricane/blob/main/Hurricane/src/main/java/com/tmt/hurricane/country/service/CountryService.java in the function existsCountryByNameOrCode the commented out query would not work, for this reason this place is currently still replaced as
return this.existsCountryByName(country_name) || this.existsCountryByCode(code);
Anyone suggestions for correcting these problems? Any comments?