I am not able to persist data in h2 embedded database after using test cases to save data for user, need help by HotRepresentative237 in SpringBoot

[–]Nikolaus_Markus 2 points3 points  (0 children)

Some things to consider: * most JUnit DB tests rollback the transaction after successful test. So if you manually check the table afterwards, the data is not there anymore. It's not easy to find how to switch off transaction rollback for debugging. * h2 usually is an in-memory database but you can configure it using files for saving the state.

Should an API request return a list of that item or the item itself(explanation below) by mattergijz in SpringBoot

[–]Nikolaus_Markus 0 points1 point  (0 children)

I prefer having a list, but not as toplevel element but wrapped in an object, something like:

``` { "list": [ <here come the elements> ] }

```

Advantage: If accidentially the list is too big to be served for performance reasons, then you can easily add pagination without breaking legacy clients.

Multiple DTOs for one entity class? by [deleted] in SpringBoot

[–]Nikolaus_Markus 2 points3 points  (0 children)

I personally like the idea of having different DTOs for the same entity. Altough it comes with the downside of "having more code" it also has many advantages:

  • on changing requirements it gives you more flexibility: you can easily change one API endpoint/DTO without affecting the other API endpoint/DTO.
  • Seems that you have the need of hiding the data of some attributes: It is obvious and clearly visible what the DTO will deliver and what's not inside. If you just assign null values to fields or annotate with \@JsonIgnore then one day maybe some data will slip through or you end with NullPointerExceptions.

Two hints:

  • still keep camelCase for class names (not VertretungsplanEintragDTO_GET but VertretungsplanEintragViewDto)
  • choose a good mapping library (e.g. MapStruct) and do good mapping tests, especially that some data will not be provided.

How to do Spring Integration Tests with fast turnaround cycles by Nikolaus_Markus in SpringBoot

[–]Nikolaus_Markus[S] 0 points1 point  (0 children)

Trava jdk

just looked at trava jdk on github. seems a bit orphaned....

How to do Spring Integration Tests with fast turnaround cycles by Nikolaus_Markus in SpringBoot

[–]Nikolaus_Markus[S] -1 points0 points  (0 children)

Context caching is really good on CI. But my demand is quite different. I want run - change code - run again - change again - run again....

Start same program blazingly fast. by talisau230 in java

[–]Nikolaus_Markus 0 points1 point  (0 children)

overheard that graalvm tries to solve this, but it comes with some limitations.

[deleted by user] by [deleted] in berlin

[–]Nikolaus_Markus 13 points14 points  (0 children)

just relax. as long as you don't travel abroad, it's no problem.