1 2 12 package com.versant.core.ejb.query; 13 14 import com.versant.core.metadata.ClassMetaData; 15 import com.versant.core.common.CmdBitSet; 16 17 21 public abstract class NavBase { 22 23 26 protected NavField children; 27 28 31 public Object storeObject; 32 33 public NavBase() { 34 } 35 36 39 public NavField findChild(String name, boolean outer, boolean fetch) { 40 NavField i; 41 for (i = children; i != null; i = i.getNext()) { 42 if (i.getFmd().name.equals(name) && i.isOuter() == outer 43 && i.isFetch() == fetch) { 44 return i; 45 } 46 } 47 return null; 48 } 49 50 53 public abstract NavRoot getRoot(); 54 55 58 public abstract ClassMetaData getNavClassMetaData(); 59 60 63 protected void childrenToString(StringBuffer s) { 64 if (children != null) { 65 if (children.getNext() == null) { 66 s.append(" -> "); 67 s.append(children); 68 } else { 69 for (NavField f = children; f != null; f = f.getNext()) { 70 s.append(" [ -> "); 71 s.append(children); 72 s.append("] "); 73 } 74 } 75 } 76 } 77 78 83 public void addInvolvedClasses(CmdBitSet bits) { 84 bits.addPlus(getNavClassMetaData()); 85 for (NavField i = children; i != null; i = i.getNext()) { 86 i.addInvolvedClasses(bits); 87 } 88 } 89 90 public NavField getChildren() { 91 return children; 92 } 93 94 } 95 96 | Popular Tags |