1 30 package com.genimen.djeneric.tools.strongtyper; 31 32 public class OqlGenerator extends Generator 33 { 34 public OqlGenerator() 35 { 36 } 37 38 public String getPackageName() 39 { 40 return getImplPackageName(); 41 } 42 43 public String getClassName() 44 { 45 return getOqlClassName() + (isAbstract() ? getGeneratedSuffix() : ""); 46 } 47 48 public String getCode() throws Exception 49 { 50 StringBuffer code = new StringBuffer (5000); 51 if (getPackageName().trim().length() > 0) code.append("package " + getPackageName() + ";\n\n"); 52 53 code.append("import com.genimen.djeneric.repository.*;\n"); 54 code.append("import " + getItfPackageName() + ".*;\n"); 55 56 code.append(StrongTyper.getRegenerationTags(1)); 57 58 code.append("\n" + "public class " + getClassName() + " extends DjOql implements " + getOqlInterfaceName() + "\n" 59 + "{\n" + " public " + getClassName() + "(DjExtent extent)\n" + " {\n" + " super(extent);\n" 60 + " }\n" + "\n"); 61 62 code.append(StrongTyper.getRegenerationTags(0)); 63 code.append("}\n"); 64 65 return code.toString(); 66 } 67 68 } | Popular Tags |