Archive for the ‘Java’ Category

Spring 3 + JPA 2.0 + Hibernate 3.5.1-Final + Wicket 1.4.9 + Maven 2

This is just a quick note for someone want to use Spring 3, Jpa 2, Hibernate 3, Wicket within Maven 2 project.
You can download an example project at here and remember that only Spring version from 3.0.1 supports JPA 2 fully.
I. Add properties and dependencies into your POM.XML file
1. Add properties
<properties>

Continue Reading...

Effective JPA: Use Enumeration Effectively

How to persist an enumeration effectively? Here is my experience.

Continue Reading...

Fluent Interface

Recently, I’ve played with my own  framework. I found a new term, called “Fluent Interface“. There is a great article on bliki of Martin Fowler about this term, you can read it if you have not heard about it yet.
The idea of  “Fluent Interface” is instead of returning void in  setter methods of an object, …

Continue Reading...

Đoạn mã Java khá thú vị

Theo các bạn thì đoạn mã Java này có biên dịch được không? Không dùng bất cứ tool gì để compile trước khi trả lời nhé. Hãy dùng kiến thức về Java của các bạn để suy luận:
public class Quiz {
public static void main(String[] args) {

Continue Reading...

Singleton Pattern: When and How to use it effectively

With this post I will show you what it Singleton Pattern and how to use it  effectively.
First, consider definition for Singleton Patten:
The Singleton Pattern ensures a class has only one instance, and provides a global point of access to it.
From this definition we can see the purpose of using this pattern:

It ensures we have at …

Continue Reading...