Java Code Geeks » Michal Jastak http://www.javacodegeeks.com/ Java 2 Java Developers Resource Center Tue, 21 Apr 2015 22:00:41 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.1 Serialization Proxy Pattern examplehttp://www.javacodegeeks.com/2014/06/serialization-proxy-pattern-example.html http://www.javacodegeeks.com/2014/06/serialization-proxy-pattern-example.html#comments Tue, 17 Jun 2014 07:00:10 +0000 http://www.javacodegeeks.com/?p=26594 There are books, which change your life immensely. One of such books is “Effective Java” by Joshua Bloch. Below you may find small experiment, which was inspired by Chapter 11 of this book – “Serialization”. Suppose that we have a class designed for inheritance, which is not Serializable itself, and has no parameterless constructor, like ...

 

]]>
http://www.javacodegeeks.com/2014/06/serialization-proxy-pattern-example.html/feed/ 0
JPA – Querydsl Projectionshttp://www.javacodegeeks.com/2013/05/jpa-querydsl-projections.html http://www.javacodegeeks.com/2013/05/jpa-querydsl-projections.html#comments Tue, 14 May 2013 13:00:59 +0000 http://www.javacodegeeks.com/?p=12753 In my last post: JPA – Basic Projections – I’ve mentioned about two basic possibilities of building JPA Projections. This post brings you more examples, this time based on Querydsl framework. Note, that I’m referring Querydsl version 3.1.1 here. Reinvented constructor expressions Take a look at the following code:         ... import ...

 

]]>
http://www.javacodegeeks.com/2013/05/jpa-querydsl-projections.html/feed/ 1
JPA – Should I become a laziness extremist?http://www.javacodegeeks.com/2013/05/jpa-should-i-become-a-laziness-extremist.html http://www.javacodegeeks.com/2013/05/jpa-should-i-become-a-laziness-extremist.html#comments Wed, 01 May 2013 10:00:40 +0000 http://www.javacodegeeks.com/?p=12140 When you spoke with the Developers about mapping objects to relational databases, they very often complain about poor JPA performance, unpredictable behavior of JPA Providers, etc. Usually at some point of the conversation you will hear: “Let’s drop this technology at all, we’ve seen something much better on the conference last month. We will use ...

 

]]>
http://www.javacodegeeks.com/2013/05/jpa-should-i-become-a-laziness-extremist.html/feed/ 2
JPA – Hibernate – Type mapping on package levelhttp://www.javacodegeeks.com/2013/04/jpa-hibernate-type-mapping-on-package-level.html http://www.javacodegeeks.com/2013/04/jpa-hibernate-type-mapping-on-package-level.html#comments Tue, 09 Apr 2013 07:00:34 +0000 http://www.javacodegeeks.com/?p=10965 When we are finally mature enough to use some custom types mapping in JPA, we usually stuck with some provider specific solution, because JPA itself doesn’t define any mechanism for doing it. Let me show you an example of custom type mapping definition for one of the JPA providers – Hibernate. Suppose that we use ...

 

]]>
http://www.javacodegeeks.com/2013/04/jpa-hibernate-type-mapping-on-package-level.html/feed/ 6
Spring’s Web MVC – Redirect to the Memory Leakhttp://www.javacodegeeks.com/2012/12/springs-web-mvc-redirect-to-the-memory-leak.html http://www.javacodegeeks.com/2012/12/springs-web-mvc-redirect-to-the-memory-leak.html#comments Fri, 07 Dec 2012 17:00:05 +0000 http://www.javacodegeeks.com/?p=4934 They say that one rock can cause an avalanche. Lately, one of my Colleagues, Marcin Radoszewski, gave me such a rock. You’ll probably never guess what it is, but there is a chance, that you use it in many of your Web Applications. Allow me to introduce this rock to you. You probably well know ...

 

]]>
http://www.javacodegeeks.com/2012/12/springs-web-mvc-redirect-to-the-memory-leak.html/feed/ 3
Customize PMD in Eclipse with your own ruleshttp://www.javacodegeeks.com/2012/10/customize-pmd-in-eclipse-with-your-own.html http://www.javacodegeeks.com/2012/10/customize-pmd-in-eclipse-with-your-own.html#comments Tue, 09 Oct 2012 22:00:00 +0000 http://www.javacodegeeks.com/2012/10/customize-pmd-in-eclipse-with-your-own-rules.html PMD is very nice Java code scanner which helps you avoid potential programming problems. It can be easily extended to your needs, and this post will bring you simple example of custom PMD rules related to JPA’s @Enumerated annotation usage. Before you’ll continue the reading, you should check one of my previous posts – JPA ...

 

]]>
http://www.javacodegeeks.com/2012/10/customize-pmd-in-eclipse-with-your-own.html/feed/ 0
JSON – Jackson to the rescuehttp://www.javacodegeeks.com/2012/09/json-jackson-to-rescue.html http://www.javacodegeeks.com/2012/09/json-jackson-to-rescue.html#comments Fri, 07 Sep 2012 19:00:00 +0000 http://www.javacodegeeks.com/2012/10/json-jackson-to-the-rescue.html Sometimes you have to fetch some data from the server in JavaScript, JSON is pretty good choice for this task. Let’s play with the Employer – Employee – Benefit example from the post JPA Demystified (episode 1) – @OneToMany and @ManyToOne mappings. We will use it inside the web application based on Spring Framework. Our ...

 

]]>
http://www.javacodegeeks.com/2012/09/json-jackson-to-rescue.html/feed/ 1
FindBugs and JSR-305http://www.javacodegeeks.com/2012/03/findbugs-and-jsr-305.html http://www.javacodegeeks.com/2012/03/findbugs-and-jsr-305.html#comments Thu, 15 Mar 2012 01:48:00 +0000 http://www.javacodegeeks.com/2012/10/findbugs-and-jsr-305.html Suppose that group of developers work in parallel on parts of big project – some developers are working on service implementation, while others are working on code using this service. Both groups agreed on service API, and started working separately, having in mind the API assumptions… Do you think this story will have happy end? ...

 

]]>
http://www.javacodegeeks.com/2012/03/findbugs-and-jsr-305.html/feed/ 1
Spring MVC – Flash Attributeshttp://www.javacodegeeks.com/2012/02/spring-mvc-flash-attributes.html http://www.javacodegeeks.com/2012/02/spring-mvc-flash-attributes.html#comments Thu, 23 Feb 2012 13:03:00 +0000 http://www.javacodegeeks.com/2012/10/spring-mvc-flash-attributes.html Latest Spring Framework incarnation (3.1) brought interesting feature called Flash Attributes. It is remedy for the problem mentioned a long time ago, in one of my posts: Spring MVC – Session Attributes handling. This problem can be described in few words: if we want to pass the attributes via redirect between two controllers, we cannot ...

 

]]>
http://www.javacodegeeks.com/2012/02/spring-mvc-flash-attributes.html/feed/ 2
Spring Insight – Web Application Profilinghttp://www.javacodegeeks.com/2011/10/spring-insight-web-application.html http://www.javacodegeeks.com/2011/10/spring-insight-web-application.html#comments Thu, 06 Oct 2011 11:57:00 +0000 http://www.javacodegeeks.com/2012/10/spring-insight-web-application-profiling.html Are you writing Web Applications using Spring Framework? Have you ever thought what’s going on under the hood? Why your application is responding so slowly? Why the snail outside your window is disappearing in the distance so fast while you still wait for your application response? You should :) and the Spring Insight can be ...

 

]]>
http://www.javacodegeeks.com/2011/10/spring-insight-web-application.html/feed/ 0