|
21 | 21 | import java.util.ArrayList;
|
22 | 22 | import java.util.Arrays;
|
23 | 23 | import java.util.Collection;
|
| 24 | +import java.util.Collections; |
24 | 25 | import java.util.Enumeration;
|
25 | 26 | import java.util.HashMap;
|
26 | 27 | import java.util.Iterator;
|
|
34 | 35 | import org.eclipse.persistence.expressions.Expression;
|
35 | 36 | import org.eclipse.persistence.internal.helper.DatabaseField;
|
36 | 37 | import org.eclipse.persistence.internal.helper.DatabaseTable;
|
| 38 | +import org.eclipse.persistence.internal.helper.Helper; |
37 | 39 | import org.eclipse.persistence.internal.identitymaps.CacheId;
|
38 | 40 | import org.eclipse.persistence.internal.queries.MappedKeyMapContainerPolicy;
|
39 | 41 | import org.eclipse.persistence.internal.sessions.AbstractRecord;
|
@@ -424,8 +426,11 @@ public Object getFieldValue(Object objectValue, AbstractSession session) {
|
424 | 426 | Object fieldValue = objectValue;
|
425 | 427 | if (mapping != null) {
|
426 | 428 | if (mapping.isAbstractDirectMapping() || mapping.isDirectCollectionMapping()) {
|
| 429 | + |
427 | 430 | // CR#3623207, check for IN Collection here not in mapping.
|
428 |
| - if (objectValue instanceof Collection) { |
| 431 | + // Translate the individual elements of a collection to match the mapping, but only if the mapping is not to a collection itself |
| 432 | + Class<?> cls = mapping.getFieldClassification(getField()); |
| 433 | + if (objectValue instanceof Collection && (cls != null && !(cls.isArray() || cls.isInstance(Collection.class)))) { |
429 | 434 | // This can actually be a collection for IN within expressions... however it would be better for expressions to handle this.
|
430 | 435 | Collection values = (Collection)objectValue;
|
431 | 436 | Vector fieldValues = new Vector(values.size());
|
|
0 commit comments