Ejemplo n.º 1
0
 @Override
 protected boolean isCacheUseable(final Function<Class, EntityInfo> entityApplyer) {
   if (this.joinEntity == null) this.joinEntity = entityApplyer.apply(this.joinClass);
   if (!this.joinEntity.isCacheFullLoaded()) return false;
   if (this.nodes == null) return true;
   for (FilterNode node : this.nodes) {
     if (!node.isCacheUseable(entityApplyer)) return false;
   }
   return true;
 }
Ejemplo n.º 2
0
 @Override
 protected <T> CharSequence createSQLJoin(
     final Function<Class, EntityInfo> func,
     final Map<Class, String> joinTabalis,
     final EntityInfo<T> info) {
   boolean morejoin = false;
   if (this.joinEntity == null) {
     if (this.joinClass != null) this.joinEntity = func.apply(this.joinClass);
     if (this.nodes != null) {
       for (FilterNode node : this.nodes) {
         if (node instanceof FilterJoinNode) {
           FilterJoinNode joinNode = ((FilterJoinNode) node);
           if (joinNode.joinClass != null) {
             joinNode.joinEntity = func.apply(joinNode.joinClass);
             if (this.joinClass != null && this.joinClass != joinNode.joinClass) morejoin = true;
           }
         }
       }
     }
   }
   StringBuilder sb = new StringBuilder();
   if (this.joinClass != null) {
     sb.append(createElementSQLJoin(joinTabalis, info, this));
   }
   if (morejoin) {
     Set<Class> set = new HashSet<>();
     if (this.joinClass != null) set.add(this.joinClass);
     for (FilterNode node : this.nodes) {
       if (node instanceof FilterJoinNode) {
         FilterJoinNode joinNode = ((FilterJoinNode) node);
         if (!set.contains(joinNode.joinClass)) {
           CharSequence cs = createElementSQLJoin(joinTabalis, info, joinNode);
           if (cs != null) {
             sb.append(cs);
             set.add(joinNode.joinClass);
           }
         }
       }
     }
   }
   return sb;
 }