1 56 57 package org.objectstyle.cayenne.dba; 58 59 import java.sql.Connection ; 60 import java.sql.PreparedStatement ; 61 import java.sql.SQLException ; 62 import java.util.Collection ; 63 64 import org.objectstyle.cayenne.access.DataNode; 65 import org.objectstyle.cayenne.access.OperationObserver; 66 import org.objectstyle.cayenne.access.QueryTranslator; 67 import org.objectstyle.cayenne.access.trans.QualifierTranslator; 68 import org.objectstyle.cayenne.access.trans.QueryAssembler; 69 import org.objectstyle.cayenne.access.types.ExtendedTypeMap; 70 import org.objectstyle.cayenne.map.DbAttribute; 71 import org.objectstyle.cayenne.map.DbEntity; 72 import org.objectstyle.cayenne.map.DbRelationship; 73 import org.objectstyle.cayenne.query.BatchQuery; 74 import org.objectstyle.cayenne.query.Query; 75 import org.objectstyle.cayenne.query.SQLAction; 76 77 88 public interface DbAdapter { 89 90 96 public String getBatchTerminator(); 97 98 104 public DataNode createDataNode(String name); 105 106 117 public QueryTranslator getQueryTranslator(Query query) throws Exception ; 118 119 public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler); 121 122 127 public SQLAction getAction(Query query, DataNode node); 128 129 132 public boolean supportsFkConstraints(); 133 134 139 public boolean supportsUniqueConstraints(); 140 141 147 public boolean supportsGeneratedKeys(); 148 149 152 public boolean supportsBatchUpdates(); 153 154 158 public String dropTable(DbEntity ent); 159 160 164 public String createTable(DbEntity ent); 165 166 171 public String createUniqueConstraint(DbEntity source, Collection columns); 172 173 177 public String createFkConstraint(DbRelationship rel); 178 179 183 public String [] externalTypesForJdbcType(int type); 184 185 191 public ExtendedTypeMap getExtendedTypes(); 192 193 196 public PkGenerator getPkGenerator(); 197 198 210 public DbAttribute buildAttribute( 211 String name, 212 String typeName, 213 int type, 214 int size, 215 int precision, 216 boolean allowNulls); 217 218 221 public void bindParameter( 222 PreparedStatement statement, 223 Object object, 224 int pos, 225 int sqlType, 226 int precision) throws SQLException , Exception ; 227 228 232 public String tableTypeForTable(); 233 234 238 public String tableTypeForView(); 239 240 243 public boolean shouldRunBatchQuery( 244 DataNode node, 245 Connection con, 246 BatchQuery query, 247 OperationObserver delegate) throws SQLException , Exception ; 248 } | Popular Tags |