Advertisement
NLinker

Untitled

Apr 4th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. class O {
  2.   public String field;
  3. }
  4.  
  5. StringTemplate query = new StringTemplate(
  6.       "UPDATE customers SET customerName='$customer$'," +
  7.       " customerAddress='$address$' WHERE id=$id$ AND $o.field$ IS NOT NULL");
  8.  
  9. query.setAttribute("customer", "Frank");
  10. query.setAttribute("address", "1313 Mocking Bird Lane");
  11. query.setAttribute("id", "4453");
  12. O o = new O();
  13. o.field = "date";
  14. query.setAttribute("o", o);
  15.  
  16. System.out.println(query);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement