BEITRÄGE MIT TAG #Java
Custom String Comparison in Java
Why You Should Learn Functional Programming: Type Classes vs. Interfaces
Parsing JSON Arrays as Objects with Jackson
How long does a line of Java code execute?
System.currentTimeMillis() calls before and after the line and finding the difference. But what if this line of code is part of a library or a framework? You could use a profiler, but a quicker and easier way might be to use breakpoints in IDEA.Kotlin: Type Aliases and Inline Classes
Hibernate Extended Bytecode Enhancement
enableExtendedEnhancement intended for fine-tuning of the bytecode enhancement. This option is not described well in the documentation. This article explains what it is, how to use it, and what benefits it may bring to you.How to quickly de-lombok a val in IntelliJ IDEA
val keyword which is similar to Java 11’s local variable type inference, which is otherwise inaccessible in Java 8. Instead of saying:How to write complex QueryDSL queries with attribute maps
Best practice: Establishing a border of trust
Sending large attachments via SOAP and MTOM in Java
Sometimes you need to pass a large chunk of unstructured (possibly even binary) data via SOAP protocol — for instance, you wish to attach a file to a message. The default way to do this is to pass the data in an XML element with base64Binary type. What it effectively means is, your data will be Base64-encoded and passed inside the message body. Not only your data gets enlarged by about 30%, but also any client or server that sends or receives such message will have to parse it entirely which may be time and memory consuming on large volumes of data.
Of Domain Modeling, Separation of Concerns, and How the JPA Annotations Fail at Both
Not all of the JPA annotations are actually about mapping the entities to the database, or even about persistence at all. Some of them are intended to instrument the Java language for better modeling of the domain. Here’s a simple example of two domain classes that are somehow associated with each other (accessor methods are omitted for clarity):
Integrating DBUnit with Spring TestContext Framework
The Spring Framework 2.5 came with a new TestContext framework which made integration testing of database code a lot easier. It provided annotations to declaratively specify the application context to execute your test in, annotations to mark the transactions for test methods, and also some base test classes for JUnit and TestNG. In the following article I will describe an approach for integrating the TestContext framework with the DBUnit framework, which in turn allows you to initialize the test database before test and verify its condition with the expected dataset after the test is complete.