1 2 12 package com.versant.core.metadata.parser; 13 14 import com.versant.core.common.Debug; 15 16 import java.io.PrintStream ; 17 18 21 public final class JdoQuery extends JdoElement { 22 23 public String name; 25 public String language; 26 public int ignoreCache; 27 public int includeSubclasses; 28 public String ordering; 29 public int rangeStart; 30 public int rangeEnd; 31 32 public String filter; 34 35 public String sql; 37 38 public String imports; 40 public String parameters; 41 public String variables; 42 43 public String result; 45 public String resultClass; 46 public String grouping; 47 public int unique; 48 49 public JdoExtension[] extensions; 50 51 public JdoClass parent; 52 53 public JdoElement getParent() { 54 return parent; 55 } 56 57 60 public String getCandidateClass() { 61 return parent.parent.name + "." + parent.name; 62 } 63 64 70 public String getSubContext() { 71 return "query[" + name + "]"; 72 } 73 74 public String toString() { 75 StringBuffer s = new StringBuffer (); 76 s.append("query["); 77 s.append(name); 78 s.append("] language="); 79 s.append(language); 80 s.append(" ignore-cache="); 81 s.append(ignoreCache); 82 s.append(" include-subclasses="); 83 s.append(includeSubclasses); 84 s.append("\nfilter["); 85 s.append(filter); 86 s.append("]"); 87 s.append("\ndeclarations imports="); 88 s.append(imports); 89 s.append(" parameters="); 90 s.append(parameters); 91 s.append(" variables="); 92 s.append(variables); 93 s.append(" ordering="); 94 s.append(ordering); 95 s.append("\nresult class="); 96 s.append(resultClass); 97 s.append(" grouping="); 98 s.append(grouping); 99 s.append(" unique="); 100 s.append(unique); 101 102 return s.toString(); 103 } 104 105 public void dump() { 106 dump(Debug.OUT, ""); 107 } 108 109 public void dump(PrintStream out, String indent) { 110 out.println(indent + this); 111 String is = indent + " "; 112 if (extensions != null) { 113 for (int i = 0; i < extensions.length; i++) { 114 extensions[i].dump(out, is); 115 } 116 } 117 } 118 } 119 | Popular Tags |