java语言基础

1、String format用法:

String query = "FROM Resource WHERE 1=1 %s";
        String condition =  "AND type=1 OR type=2 ";
        String hql = String.format(query, condition);

 

posted @ 2015-02-27 15:16  tyb1222  阅读(272)  评论(0编辑  收藏  举报