예제 #1
0
 protected SQLBindings createBindings(QueryMetadata metadata, SQLSerializer serializer) {
   String queryString = serializer.toString();
   ImmutableList.Builder<Object> args = ImmutableList.builder();
   Map<ParamExpression<?>, Object> params = metadata.getParams();
   for (Object o : serializer.getConstants()) {
     if (o instanceof ParamExpression) {
       if (!params.containsKey(o)) {
         throw new ParamNotSetException((ParamExpression<?>) o);
       }
       o = metadata.getParams().get(o);
     }
     args.add(o);
   }
   return new SQLBindings(queryString, args.build());
 }
예제 #2
0
 protected SQLSerializer createSerializer() {
   SQLSerializer serializer = new SQLSerializer(configuration, true);
   serializer.setUseLiterals(useLiterals);
   return serializer;
 }