Category Archives: Java

Importing WSDL with Java and Maven

SOAP web services are often used in commercial software. If we plan to use existing SOAP web service, we should receive a WSDL file which defines the contract between the web service and its clients. This contract defines at least: … Continue reading

Posted in Java, Java EE, Maven, Web-Services, XML | Tagged , , , , | Leave a comment

Objects utility class in Java

Today I would like to quickly mention java.util.Objects class. The JavaDoc documentation for this class says: This class consists of static utility methods for operating on objects. These utilities include null-safe or null-tolerant methods for computing the hash code of … Continue reading

Posted in Java | Tagged | Leave a comment

Default and static methods in interfaces in Java 8

Before Java 8 interfaces could only contain static fields (usually simple constants) and abstract methods. Java 8 provided the ability to define concrete (default and static) methods in interfaces. This new language feature is used extensively in Java core packages. … Continue reading

Posted in Java | Tagged | Leave a comment

Database schema creation in JPA using SQL scripts

Recent versions of JPA provide a feature to automatically create the database objects (like tables, sequences or indexes), load initial data into database on application deployment; and also remove them after the application is undeployed. All that is needed is … Continue reading

Posted in Hibernate, Java, Java EE, JPA | Tagged , , , | Leave a comment

Reading text file line by line in Java

Reading text files from hard disk is quite common task in software development practice. Usually we are interested in processing it line by line. In this article I would like to present few popular ways how to do it easily … Continue reading

Posted in Java | Tagged , | Leave a comment

Iterating through Java list backwards

The most natural method of iterating through a list in Java is to start from the first element of the list and then move forward until the last one is reached. While this is the most common, it is sometimes … Continue reading

Posted in Guava, Java | Tagged , | 1 Comment

Usage of serialVersionUID in Java serialization

Java run-time associates with each serializable class a special version number known as serialVersionUID. This number is later used during deserialization process to verify if the application which performed the serialization and the application which is doing the deserialization have … Continue reading

Posted in Java | Tagged | Leave a comment