OPENJPA-1289 Added Oracle specific type to compatibility checking method. Added new method to dictionary to pass in XML indicator. Updated Oracle dictionary to use it to make LOB determination.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@813098 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jeremy Bauer 2009-09-09 19:56:37 +00:00
parent 2691db6e0b
commit ed40459a2a
4 changed files with 32 additions and 1 deletions

View File

@ -683,7 +683,7 @@ public abstract class MappingInfo
} }
type = type =
dict.getJDBCType(tmplate.getJavaType(), size == -1, precis, dict.getJDBCType(tmplate.getJavaType(), size == -1, precis,
scale); scale, tmplate.isXML());
} }
boolean ttype = true; boolean ttype = true;

View File

@ -642,6 +642,15 @@ public class Column
default: default:
return false; return false;
} }
case 2007: // Oracle-defined opaque type code for XMLType
switch (type) {
case Types.CHAR:
case Types.LONGVARCHAR:
case Types.VARCHAR:
return true;
default:
return false;
}
default: default:
return type == getType(); return type == getType();
} }

View File

@ -1486,6 +1486,15 @@ public class DBDictionary
return getJDBCType(metaTypeCode, lob, 0, 0); return getJDBCType(metaTypeCode, lob, 0, 0);
} }
/**
* Return the preferred {@link Types} constant for the given
* {@link JavaTypes} or {@link JavaSQLTypes} constant.
*/
public int getJDBCType(int metaTypeCode, boolean lob, int precis,
int scale, boolean xml) {
return getJDBCType(metaTypeCode, lob, precis, scale);
}
/** /**
* Return the preferred {@link Types} constant for the given * Return the preferred {@link Types} constant for the given
* {@link JavaTypes} or {@link JavaSQLTypes} constant. * {@link JavaTypes} or {@link JavaSQLTypes} constant.

View File

@ -41,6 +41,7 @@ import java.util.Set;
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration; import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
import org.apache.openjpa.jdbc.kernel.exps.FilterValue; import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
import org.apache.openjpa.jdbc.meta.JavaSQLTypes;
import org.apache.openjpa.jdbc.schema.Column; import org.apache.openjpa.jdbc.schema.Column;
import org.apache.openjpa.jdbc.schema.ForeignKey; import org.apache.openjpa.jdbc.schema.ForeignKey;
import org.apache.openjpa.jdbc.schema.Index; import org.apache.openjpa.jdbc.schema.Index;
@ -51,6 +52,7 @@ import org.apache.openjpa.lib.jdbc.DelegatingDatabaseMetaData;
import org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement; import org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement;
import org.apache.openjpa.lib.util.J2DoPrivHelper; import org.apache.openjpa.lib.util.J2DoPrivHelper;
import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.lib.util.Localizer;
import org.apache.openjpa.meta.JavaTypes;
import org.apache.openjpa.util.StoreException; import org.apache.openjpa.util.StoreException;
import org.apache.openjpa.util.UserException; import org.apache.openjpa.util.UserException;
@ -874,6 +876,17 @@ public class OracleDictionary
return sql; return sql;
} }
/**
* Return the preferred {@link Types} constant for the given
* {@link JavaTypes} or {@link JavaSQLTypes} constant.
*/
@Override
public int getJDBCType(int metaTypeCode, boolean lob, int precis,
int scale, boolean xml) {
return getJDBCType(metaTypeCode, lob && !xml, precis, scale);
}
protected String getSequencesSQL(String schemaName, String sequenceName) { protected String getSequencesSQL(String schemaName, String sequenceName) {
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
buf.append("SELECT SEQUENCE_OWNER AS SEQUENCE_SCHEMA, "). buf.append("SELECT SEQUENCE_OWNER AS SEQUENCE_SCHEMA, ").