Hello everyone,
Today I would like to make an exception to not report our usual serious, high quality discussions on our technical list, but to bring you a gem on our offtopic list. The original discussion was in Dutch because it was sent to the dutch mailing list, but I will try to translate, if only for our Indian and French coworkers who had to witness the Dutch on the offtopic list, where it was quickly taken..
Apologies in advance for any translation errors..
Filed under General, Techlist | 5 Comments »
Recently I wanted to add an aspect to some domain object, so that it was saved, the moment it changed state. However, after adding this aspect, the whole build of course failed, because a lot of the unit tests weren't expecting the calls which were now woven into the domain object.
(more...)
Filed under AOP, Java, Spring, Testing | 5 Comments »
A new week a new podcast. This week we have Gero Vermaas from Xebia and Andreas Ebbert-Karroum from Nokia Siemens Networks to talk about the just released JSR264 Order Management API.
Not only do they explain what the order management api is but they also explain how the team worked to create the JSR. (think SCRUM
)
So head over to the podcast page or subscribe!
Filed under Agile, Java, Podcast, Telecommunications | 1 Comment »
Entity inheritance mapping in Hibernate can easily be done by following one of the three strategies and many a times instance of which subclass has to be created is identified by the value of the discriminator column (particularly in the case of table per class hierarchy). For such mappings there is already an inherent support in Hibernate.
So this is good if we want to create a sub class of a specific type for each row but what about if we want to create an instance of a specific class for a value of a column within that row. So in a way some type of component inheritance mapping. This is required if I really do not want to convert a value object (component) into an entity as that might mean sacrifice on the part of good model design as I am loosing the distinction between a component and an entity.
A workaround for the moment could be to somehow use a UserType to create instance of such objects based upon the value stored in the column. The concept of discriminator column can still help us. Let’s see how by taking up the following example
Filed under Hibernate, Java | 3 Comments »
At a client we are now using files and datasources together. We want the write actions to the database and the files to be in one transaction. We want this because the files represent the database data for legacy applications. As there is no distributed transaction API for files which is JTA (Java Transaction API) compatible we had to find a solution to implement this. This post describes the (big) steps we did and the solution we found. Of course, you can skip the steps and go straight to the solution. ![]()
(more...)
Filed under Hibernate, JTA, Java, Testing | 2 Comments »
The Order Management API 1.0 has been released. The Order Management API is (as far as we in the JSR264 Expert Group (EG) know) the only open and standards based API available for order management and is relevant for any organization developing an order management solution. By using this API as a basis for your Order Management solution you can reuse the knowledge of others (not reinventing the wheel), reduce your integration costs and create a flexible Order Management solution.
In a previous blog post I already described the features of the API in detail, so I'll just repeat the most important features:
The JSR264 specification can be downloaded from the JCP website. The Reference Implementation (RI) and Technology Compatibility Kit (TCK) are available at the TelemanagementForum website. More information on JSR264 can be found at the JSR264 java.net site.
Filed under Agile, Java, Telecommunications | 2 Comments »
How to close resources is not rocket science. But still I see in many projects, including my own, that resources are not properly closed. Most of the time people tend to forget to close the resources in a finally block or forget that closing a resource might also throw an Exception what may cause Exception swallowing.
In Java 5 the Closable interface was introduced which enables some convenient ways to handle closing resources.
Let's take a look at an example that I will use throughout this blog to show what problems can occur when handling resources and how we can refactor the sample code so that it safely closes the used resource.
Filed under Java | 13 Comments »
Dozer is a Java Bean to Java Bean mapper that recursively copies data from one object to another. Typically, these Java Beans will be of different complex types. This blog will explain you how to convert one Java Bean into another Java Bean by using context type mapping[Dozer mappings], also you can convert one variable type into another variable type by defining them into XML file.
(more...)
Filed under Java | 3 Comments »
DbUnit is a JUnit extension and is very popular among developers for unit testing database-driven projects. In this blog I will discuss some of the tips to make your life easier and beautiful for DbUnit testing.
(more...)
Filed under Java | 2 Comments »