OPENJPA-539 Can't create a table with a field of java type "Map" in Derby

commit patch for Fay Wang. 
testcases have been modified.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@639746 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2008-03-21 18:23:19 +00:00
parent 831bd55051
commit 57ca9afbdd
4 changed files with 7 additions and 8 deletions

View File

@ -108,7 +108,10 @@ public class HandlerHandlerMapTableFieldStrategy
field.mapJoin(adapt, true);
_kio = new ColumnIO();
_kcols = HandlerStrategies.map(key, "key", _kio, adapt);
DBDictionary dict = field.getMappingRepository().getDBDictionary();
_kcols = HandlerStrategies.map(key,
dict.getValidColumnName("key", field.getTable()), _kio, adapt);
_vio = new ColumnIO();
_vcols = HandlerStrategies.map(val, "value", _vio, adapt);
field.mapPrimaryKey(adapt);

View File

@ -133,7 +133,9 @@ public class HandlerRelationMapTableFieldStrategy
field.mapJoin(adapt, true);
_kio = new ColumnIO();
_kcols = HandlerStrategies.map(key, "key", _kio, adapt);
DBDictionary dict = field.getMappingRepository().getDBDictionary();
_kcols = HandlerStrategies.map(key,
dict.getValidColumnName("key", field.getTable()), _kio, adapt);
if (val.getTypeMapping().isMapped()) {
ValueMappingInfo vinfo = val.getValueInfo();

View File

@ -25,7 +25,6 @@ import javax.persistence.Id;
import org.apache.openjpa.persistence.PersistentMap;
import org.apache.openjpa.persistence.jdbc.ContainerTable;
import org.apache.openjpa.persistence.jdbc.KeyColumn;
@Entity
public class HandlerToHandlerMapInstance {
@ -34,8 +33,6 @@ public class HandlerToHandlerMapInstance {
@PersistentMap
@ContainerTable(name="NONSTD_MAPPING_MAP")
// needed because we hard-code 'key' in the handler FieldStrategies
@KeyColumn(name="key_col")
private Map<String,String> map = new HashMap<String,String>();
public Map<String,String> getMap() {

View File

@ -25,7 +25,6 @@ import javax.persistence.Entity;
import javax.persistence.Id;
import org.apache.openjpa.persistence.PersistentMap;
import org.apache.openjpa.persistence.jdbc.KeyColumn;
import org.apache.openjpa.persistence.simple.AllFieldTypes;
@Entity
@ -34,8 +33,6 @@ public class HandlerToRelationMapInstance {
private int id;
@PersistentMap(elementCascade = CascadeType.PERSIST)
// needed because we hard-code 'key' in the handler FieldStrategies
@KeyColumn(name="key_col")
private Map<String,AllFieldTypes> map = new HashMap<String,AllFieldTypes>();
public Map<String,AllFieldTypes> getMap() {