Beispiel #1
0
 @Override
 protected void putJoinTabalis(Map<Class, String> map) {
   if (this.joinClass != null && !map.containsKey(this.joinClass))
     map.put(joinClass, String.valueOf((char) ('b' + map.size())));
   if (this.nodes == null) return;
   for (FilterNode node : this.nodes) {
     node.putJoinTabalis(map);
   }
 }
Beispiel #2
0
 private static CharSequence createElementSQLJoin(
     final Map<Class, String> joinTabalis, final EntityInfo info, final FilterJoinNode node) {
   if (node.joinClass == null) return null;
   StringBuilder sb = new StringBuilder();
   String[] joinColumns = node.joinColumns;
   sb.append(" INNER JOIN ")
       .append(node.joinEntity.getTable())
       .append(" ")
       .append(joinTabalis.get(node.joinClass))
       .append(" ON ")
       .append(info.getSQLColumn("a", joinColumns[0]))
       .append(" = ")
       .append(node.joinEntity.getSQLColumn(joinTabalis.get(node.joinClass), joinColumns[0]));
   for (int i = 1; i < joinColumns.length; i++) {
     sb.append(" AND ")
         .append(info.getSQLColumn("a", joinColumns[i]))
         .append(" = ")
         .append(node.joinEntity.getSQLColumn(joinTabalis.get(node.joinClass), joinColumns[i]));
   }
   return sb;
 }