The usual way of dependency injection with CDI using @Inject offers an extremely efficient mechanism to supply an object with its dependencies. However, there are scenarios where a dynamic version of dependency injection is required. For those cases, CDI offers javax.enterprise.inject.Instance, an interface that allows for the dynamic injection of new instances at runtime on […]
Fabian König
0
19.06.2020
Software developer constantly need to implement and deploy a new version of an application. In issue 5-2017 of German Java magazine, our colleague Steffen Mall argues that simple and fast refactoring of a database model is one of the most important things in order to implement flexible business requirements.
Oliver Pitzschel
0
12.04.2017
Setup your local development workspace with test data to ensure that each developer is able to start immediately on a clean and useful workspace.
Steffen Mall
0
15.03.2017
Using an object-relational mapping framework like Hibernate disburdens developers from creating complex DDL scripts to setup an application’s database schema. However, in real life such scripts are still needed – at least for the DBA who forbids applications to alter database objects. This post shows how to easily generate the database schema DDL script without typing an SQL commands.
Andreas Günzel
14.10.2016
Unit testing is essential to produce good software. As a unit test is intended to cover only a very small piece of code we need to mock out other components. This post provides an introduction into the widely used mocking framework Mockito.
Andreas Günzel
0
10.08.2016
In addition to my first liquibase post I give you some best practice in order to integrate liquibase in JUnit using hibernate JPA to ensure same datamodel during unit test and other stages. Use the power of mockito to setup your JUnit test class and inject your entity manager.
Steffen Mall
0
13.07.2016
About two weeks ago, June 15th-17th, the Java Enterprise Summit and the Microservices Summit 2016 took place in Munich, Germany. While having the chance to visit two events at the same place, there was a lot new input for all attendees.
Alexander Griesbaum
0
08.07.2016
Simple and fast refactoring of your database model is one of the most important things in order to implement flexible business requirements. Learn the basics of continuous database integration with liquibase. Liquibase supports tracking, managing and applying database schema changes. Feel the power and simplicity of liquibase.
Steffen Mall
1
07.06.2016
Long running transactions might be killed by the App Server's Transaction Reaper. I have implemented a litte helper to programmatic handle such kinds of exceptions.
Andreas Günzel
0
31.05.2016
For long running transactions sometimes we wish to commit a kind of intermediate result to the database. This sounds pretty simple – however, if we do not want to commit the current transaction, you may run into deadlock situations. In my current project I implemented a nice solution using JPA and EJB.
Andreas Günzel
0
19.05.2016
When invoking a method of an EJB we get features like transactions, security or monitoring for free. However, this only works when the method call is intercepted by the container. So, method calls within the same bean do not enjoy this benefits. There is a nice hack to solve this problem.
Paulin Nguimdoh
3
05.04.2016
When using Hibernate as JPA provider you need to tell the application which database vendor you are using. The classic approach is to set the property "hibernate.dialect". This works in most cases. However, I often have to cope with different database vendors serving the same datasource - depending on the current environment. A solution to this problem is to use a DialectResolver that dynamically detects the needed Hibernate dialect to talk to the database.
Andreas Günzel
2
23.03.2016