1 19 20 package org.netbeans.modules.j2ee.persistence.action; 21 22 28 public final class GenerationOptions { 29 30 public enum Operation { 31 PERSIST("em.persist({0});"), 32 MERGE("em.merge({0});"), 33 REMOVE("em.merge({0});\n" + "em.remove({0});"), 34 FIND("return ({2}) em.find({2}.class, {0});"), 35 FIND_ALL("return em.createQuery(\"select object(o) from {2} as o\").getResultList();"); 36 37 private String body; 38 39 private Operation(String body){ 40 this.body = body; 41 } 42 43 public String getBody(){ 44 return body; 45 } 46 } 47 48 private Operation operation; 49 private String methodName; 50 private String returnType; 51 private String parameterName; 52 private String parameterType; 53 private String queryAttribute; 54 55 56 public GenerationOptions() { 57 } 58 59 public String getMethodName() { 60 return methodName; 61 } 62 63 public Operation getOperation() { 64 return operation; 65 } 66 67 public String getParameterName() { 68 return parameterName; 69 } 70 71 public String getParameterType() { 72 return parameterType; 73 } 74 75 public void setParameterName(String parameterName) { 76 this.parameterName = parameterName; 77 } 78 79 public void setParameterType(String parameterType) { 80 this.parameterType = parameterType; 81 } 82 83 public String getQueryAttribute() { 84 return queryAttribute; 85 } 86 87 public String getReturnType() { 88 return returnType; 89 } 90 91 public void setMethodName(String methodName) { 92 this.methodName = methodName; 93 } 94 95 public void setOperation(Operation operation) { 96 this.operation = operation; 97 } 98 99 100 public void setQueryAttribute(String queryAttribute) { 101 this.queryAttribute = queryAttribute; 102 } 103 104 public void setReturnType(String returnType) { 105 this.returnType = returnType; 106 } 107 108 } 109 | Popular Tags |