1 2 12 package com.versant.core.jdbc.sql.exp; 13 14 import com.versant.core.jdbc.sql.SqlDriver; 15 import com.versant.core.jdbc.metadata.JdbcTypes; 16 import com.versant.core.util.CharBuf; 17 import com.versant.core.jdo.query.ParamNode; 18 19 import java.util.Map ; 20 21 24 public class ParamExp extends LeafExp { 25 26 public int jdbcType; 27 public SqlParamUsage usage; 28 protected int firstCharIndex; 29 30 public ParamExp(int jdbcType, SqlParamUsage usage) { 31 this.jdbcType = jdbcType; 32 this.usage = usage; 33 } 34 35 public ParamExp() { 36 } 37 38 public SqlExp createInstance() { 39 return new ParamExp(); 40 } 41 42 public SqlExp getClone(SqlExp clone, Map cloneMap) { 43 super.getClone(clone, cloneMap); 44 ParamExp cst = (ParamExp) clone; 45 46 cst.jdbcType = jdbcType; 47 if (usage != null) cst.usage = usage.getClone(cloneMap); 48 cst.firstCharIndex = firstCharIndex; 49 50 return clone; 51 } 52 53 public String toString() { 54 return super.toString() + " " + JdbcTypes.toString(jdbcType); 55 } 56 57 64 public void appendSQLImp(SqlDriver driver, CharBuf s, SqlExp leftSibling) { 65 firstCharIndex = s.size(); 66 s.append(driver.getSqlParamString(jdbcType)); 67 } 68 69 73 public int getFirstCharIndex() { 74 return firstCharIndex; 75 } 76 } 77 | Popular Tags |