Velocity

The benefit of using Velocity
1. The most important benefit is decrease the maintenance cost.
 It’s no need to looking into the java code to see what is the SQL or HQL we are using, changing one place will resolve the same problem.
 In addition, it will reduce the duplicated code, any place want to using the same SQL or HQL can just located to the VM file(Velocity template).
 The SQL and HQL script are easier to maintenance, if some tuning operation need to take on them, the only thing is to look into the script folder and investigate each SQL or HQL to see whether it has some performance issue.

2. The performance are more stable than before
 Currently, we are manually append the SQL and HQL in JAVA code. The performance are depend on the complexity of the logic. By using Velocity, the template are relatively stable. Given the parameter and check the condition will generate the different result. Later it will be shown in an example.

你可能感兴趣的:(velocity)