1 19 package org.apache.cayenne.dba; 20 21 import java.sql.PreparedStatement ; 22 import java.sql.SQLException ; 23 import java.util.Collection ; 24 25 import org.apache.cayenne.access.DataNode; 26 import org.apache.cayenne.access.trans.QualifierTranslator; 27 import org.apache.cayenne.access.trans.QueryAssembler; 28 import org.apache.cayenne.access.types.ExtendedTypeMap; 29 import org.apache.cayenne.map.DbAttribute; 30 import org.apache.cayenne.map.DbEntity; 31 import org.apache.cayenne.map.DbRelationship; 32 import org.apache.cayenne.query.Query; 33 import org.apache.cayenne.query.SQLAction; 34 35 46 public interface DbAdapter { 47 48 54 public String getBatchTerminator(); 55 56 public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler); 58 59 64 public SQLAction getAction(Query query, DataNode node); 65 66 72 public boolean supportsFkConstraints(); 73 74 79 public boolean supportsUniqueConstraints(); 80 81 87 public boolean supportsGeneratedKeys(); 88 89 92 public boolean supportsBatchUpdates(); 93 94 98 public String dropTable(DbEntity entity); 99 100 104 public String createTable(DbEntity entity); 105 106 111 public String createUniqueConstraint(DbEntity source, Collection columns); 112 113 117 public String createFkConstraint(DbRelationship rel); 118 119 123 public String [] externalTypesForJdbcType(int type); 124 125 131 public ExtendedTypeMap getExtendedTypes(); 132 133 136 public PkGenerator getPkGenerator(); 137 138 151 public DbAttribute buildAttribute( 152 String name, 153 String typeName, 154 int type, 155 int size, 156 int scale, 157 boolean allowNulls); 158 159 162 public void bindParameter( 163 PreparedStatement statement, 164 Object object, 165 int pos, 166 int sqlType, 167 int scale) throws SQLException , Exception ; 168 169 173 public String tableTypeForTable(); 174 175 179 public String tableTypeForView(); 180 } 181 | Popular Tags |