1 30 package com.genimen.djeneric.tools.strongtyper; 31 32 public class OqlInterfaceGenerator extends Generator 33 { 34 public String getPackageName() 35 { 36 return getItfPackageName(); 37 } 38 39 public OqlInterfaceGenerator() throws Exception 40 { 41 } 42 43 public String getClassName() 44 { 45 return getOqlInterfaceName() + (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 java.util.*;\n"); 54 code.append(StrongTyper.getRegenerationTags(1)); 55 56 code.append("public interface " + getClassName() + "\n{\n"); 57 58 code.append("\n" + " public void clearBaseRestrictions();\n" 59 + " public void addBaseRestriction(String restriction);\n" 60 + " public void setWhereExpression(String expression);\n" 61 + " public void setParameter(String name, Object value);\n" 62 + " public void setParameter(String name, int value);\n" 63 + " public void setParameter(String name, long value);\n" 64 + " public void setParameter(String name, double value);\n" 65 + " public void setParameter(String name, boolean value);\n" 66 + " public void setParameters(HashMap parameters);\n"); 67 68 code.append(StrongTyper.getRegenerationTags(0)); 69 code.append("}\n"); 70 71 return code.toString(); 72 } 73 74 } | Popular Tags |