1 21 package oracle.toplink.essentials.queryframework; 23 24 import java.sql.*; 26 import java.io.*; 27 28 import oracle.toplink.essentials.internal.databaseaccess.*; 30 import oracle.toplink.essentials.internal.queryframework.*; 31 import oracle.toplink.essentials.internal.parsing.ejbql.*; 32 import oracle.toplink.essentials.internal.sessions.AbstractRecord; 33 import oracle.toplink.essentials.internal.sessions.AbstractSession; 34 35 45 49 public class EJBQLCall implements Serializable, Call { 50 protected DatabaseQuery query; 52 protected String ejbqlString; 53 54 protected boolean isParsed; 56 57 61 public EJBQLCall() { 62 super(); 63 } 64 65 69 public EJBQLCall(String ejbqlString) { 70 this(); 71 this.ejbqlString = ejbqlString; 72 } 73 74 79 public DatabaseQueryMechanism buildNewQueryMechanism(DatabaseQuery query) { 80 return new EJBQLCallQueryMechanism(query, this); 81 } 82 83 86 87 92 public DatabaseQueryMechanism buildQueryMechanism(DatabaseQuery query, DatabaseQueryMechanism mechanism) { 93 return buildNewQueryMechanism(query); 94 } 95 96 public Object clone() { 97 try { 98 return super.clone(); 99 } catch (CloneNotSupportedException cnse) { 100 return null; 101 } 102 } 103 104 108 public String getCallString() { 109 return getEjbqlString(); 110 } 111 112 116 public String getEjbqlString() { 117 return ejbqlString; 118 } 119 120 124 private boolean getIsParsed() { 125 return isParsed; 126 } 127 128 131 public DatabaseQuery getQuery() { 132 return query; 133 } 134 135 140 public String getLogString(Accessor accessor) { 141 return getSQLString(); 142 } 143 144 149 public String getSQLString() { 150 return null; 151 } 152 153 157 public boolean isEJBQLCall() { 158 return true; 159 } 160 161 164 public boolean isFinished() { 165 return true; 167 } 168 169 173 public boolean isParsed() { 174 return getIsParsed(); 175 } 176 177 180 183 public void populateQuery(AbstractSession session) { 184 if (!isParsed()) { 185 (new EJBQLParserFactory()).populateQuery(getEjbqlString(), (ObjectLevelReadQuery)getQuery(), session); 187 this.setIsParsed(true); 189 } 190 } 191 192 197 public PreparedStatement prepareStatement(DatabaseAccessor accessor, AbstractRecord translationRow, AbstractSession session) throws SQLException { 198 return null; 199 } 200 201 205 public void setEjbqlString(java.lang.String newEjbqlString) { 206 ejbqlString = newEjbqlString; 207 } 208 209 213 public void setIsParsed(boolean newIsParsed) { 214 isParsed = newIsParsed; 215 } 216 217 221 public void setQuery(DatabaseQuery query) { 222 this.query = query; 223 } 224 225 229 public void translate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session) { 230 } 231 } 232 | Popular Tags |