Reserved word on sql
If somebody (not you we know you can’t do such stupid thing) created table with name from list of reserved words like USER don’t forget to put square brackets around table name like You should do the same with jdbc requests
If somebody (not you we know you can’t do such stupid thing) created table with name from list of reserved words like USER don’t forget to put square brackets around table name like You should do the same with jdbc requests
I found out interesting thing – when you debug your app with active connection to Mongo it could cause unexpected issue at least if use spring mongo data What I noticed If you remove all data from collection you will not be able insert any new record to that collection Sometimes getAll method could return list of nulls instead [...]
I reinstalled my OS so that mongo either. When I deploy project, following error appeared in log I spend few hours adding user in robomongo and directly from shell and restarting mongo and OS until figured out it could be issue with version of Spring Data MongoDB And yes it was that Here mentioned the same [...]
Assume we have following classes What you have to do if you would like find all storages with apples which belongs to owners with name “Jhon” In sql it looks like In jpql Pay attention on trick with function CONCAT
Don’t use UNIQUE statement like SqlServer will create constraint with random name like UQ__TableName__E39E26653F9E5D18 If you use some automation tool like Flyway you will not be able remove that constraint easily because each time when you recreate table you will get new constraint name Better solution is following in such case you can [...]
Lets assume we have bean MyBean with field createTime if you execute following code Variable ‘time’ was created and saved so that we can expect log will print “Times are equal true” but actually we’ll see “Times are equal false” When hibernate fetch Date from DB it returns java.sql.Date That’s it If you need such condition you should [...]
Вирішив поколупатись із Spring Boot і Spring Data Jpa і знайшов цікаву штуку. По дефолту у спрінга стоїть якийсь супероптимальний неймінг який використовує SNAKE_CASE і цей неймінг такий “ядучий” що навіть, якщо ви вказуєте явно camelCase назву для стовпчиків у таблиці на зразок то спрінг це ігнорує. Щоб побороти таке паскудство [...]
Цікаву багу(особливість?) знайшов у mongo/spring-data-mongo Коли зберігаєш пустий ArrayList на зразок То при вичитці монго повертає HashSet і відповідно кидає помилку Чому так стається наразі не вияснив, просто заборонив поки що зберігати порожні масиви та колекції
Recent Comments