JPA Criteria is one of the most awkward API-s I have to use on daily basis. I can’t even remember how a single thing has to be done with this API and I constantly have to refer to the docs. First it’s because they involved a lot of objects in the process, like: EntityManager
, CriteriaBuilder
, Root
entity, CriteriaQuery
which then should be converted to TypedQuery
. About all those things you have to think about where to get them from and how to use them together to build a query. Secondly, because this API expects everywhere to get abstract interfaces, like Selection
or Predicate
with no single line of documentation how to create concrete instances of these classes, and you usually have to review large CriteriaBuilder
interface to find what you want. However, writing recently in Kotlin, I’ve found some optimizations given by this language you can use to make things less abstruse.
Working recently with Hibernate batch processing I’ve followed the default pattern promoting callings session.clear()
periodically. In this article I’m going to describe what problems can be caused by this approach and how to avoid them.
Year 2020 is slowly coming to the end with no publications yet :) This is because my involvement in an exhausive startup. However this year I contributed a lot on github and to take a breath I’ve recently learned go using Go By Example tutorial. It seems a very fine way to learn go, while I like to explain a bit more and dig a little deeper. Below you can find my own in-code tutorial derived from Go By Example:
Read the full articleMySQL as well as other SQL databases doesn’t return data in a predictable order without using order by
clause. This can be a problem in some situations: for example user adding positions to an invoice can expect they’re returned in the same order from the server. The same expectation is possibly true for the most of other master-detail use cases. In this short example I’m going to show a simple trick how to achieve this.
In this article I’m showing some fundamentals of Angular Hierarchical Dependency Injection feature and why and when to use forRoot()
providers.
Working with Micronaut, what I’ve been doing recently, it’s inevitable to stumble upon RxJava and Reactive Programming concepts, especially implementing some internal Micronaut interfaces usually returning Flowable<?>
instead of ?
. Having no previous experience but beign curious about this reactive hype I decided to delve into the subject and try to understand it deeper. Even though it turned out more difficult and tricky than I expected before, I think I’ve finally caught the idea. In this article I’ll try to introduce the newcomer to my way of thinking about the reactive programming step by step.
Micronaut is a brand-new framework from Grails creators targeted to be a first choice for microservices architecture framework in Java world and the as the main Spring Boot competitor, while GraphQL is becoming recently more and more popular standard to query backend data with JSON. In this article I’m going to show how to glue both technologies to provide a complete foundation on which one can build his own Hibernate/JPA application.
Read the full articleFlowable is the open source business process engine using BPMN 2.0 standards, which has been forked from Activiti along with other famous Camunda engine. We’ve picked Flowable as our BPMN engine for one of the project I’ve been recently involved in and I’ve developed some processes using it. In this article I’d like to share some ideas about some tricky parts of this development process and how to test such processes properly.
Read the full articleIn parallel to Kotlin in the other project I’ve also been learning TypeScript. These two languages are very similar in most of concepts, however it is quite difficult to learn them both at the exact same time because of the different syntax. Again, I’ve made my own quick in-code introduction to this language.
Read the full articleI have recently been learning Kotlin. While the original Kotlin Reference is quite good, it certainly contains too much text for me to quick-start with Kotlin after years of Java development. During reading the docs and testing some syntax I’ve made my own Kotlin tutorial, which consists mostly of source code. This is probably the only thing that is required for experienced Java developer to get started.
Read the full article