Archive for the ‘Java’ Category

JPA Repository – makes your data access layer easy

This is a small open source project I’ve created to implement repository programming model with JPA 2 and Specification pattern, it provides a simple and easy way to build the data access layer. The source code is hosted at GitHub https://github.com/duydo/jpa-repository,
If you have any suggestion or feedback, don’t hesitate to drop me a line …

Continue Reading...

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...