1 25 26 27 package org.objectweb.jonas_ejb.deployment.api; 28 29 import java.lang.reflect.Method ; 30 import org.objectweb.jonas_lib.deployment.api.DeploymentDescException; 31 32 38 public class MethodJdbcCmp1Desc extends MethodDesc { 39 40 protected String whereClause = null; 41 protected int whereClauseStatus = APPLY_TO_BEAN; 42 43 46 public MethodJdbcCmp1Desc(BeanDesc beanDesc,Method meth, Class classDef, int index) { 47 super(beanDesc,meth, classDef,index); 48 } 49 50 55 void overwriteJdbcWhereClause(String jdbcWhereClause,int status) 56 throws DeploymentDescException { 57 if (status<this.whereClauseStatus) 58 return; 59 char[] iwc = jdbcWhereClause.toCharArray(); 61 char[] owc = new char[iwc.length]; 62 for (int i = 0; i < iwc.length; i++) { 63 if (Character.isWhitespace(iwc[i])) { 64 owc[i] = ' '; 65 } else { 66 owc[i] = iwc[i]; 67 } 68 } 69 whereClause = new String (owc); 70 whereClauseStatus = status; 71 } 72 73 77 public boolean hasWhereClause(){ 78 return whereClause!=null; 79 } 80 81 85 public String getWhereClause(){ 86 if (whereClause==null) { 87 throw new Error ("No whereClause defined for this method"); 88 } 89 return whereClause; 90 } 91 92 95 public int getWhereClauseStatus(){ 96 return whereClauseStatus; 97 } 98 99 103 public String toString() { 104 StringBuffer ret = new StringBuffer (); 105 ret.append(super.toString()); 106 if (hasWhereClause()) { 107 ret.append("\ngetWhereClause()="+getWhereClause()); 108 ret.append("\ngetWhereClauseStatus()="+APPLY_TO[getWhereClauseStatus()]); 109 } 110 return ret.toString(); 111 } 112 113 } 114 | Popular Tags |