Skip to content

Commit 2007ac0

Browse files
committed
Retain order
1 parent b0225cc commit 2007ac0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

doma-core/src/main/java/org/seasar/doma/jdbc/entity/EmbeddedPropertyType.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static java.util.stream.Collectors.toMap;
44

5+
import java.util.LinkedHashMap;
56
import java.util.List;
67
import java.util.Map;
78
import java.util.function.Function;
@@ -35,7 +36,14 @@ public EmbeddedPropertyType(
3536
this.embeddablePropertyTypes = embeddablePropertyType;
3637
this.embeddablePropertyTypeMap =
3738
this.embeddablePropertyTypes.stream()
38-
.collect(toMap(EntityPropertyType::getName, Function.identity()));
39+
.collect(
40+
toMap(
41+
EntityPropertyType::getName,
42+
Function.identity(),
43+
(u, v) -> {
44+
throw new IllegalStateException(String.format("Duplicate key %s", u));
45+
},
46+
LinkedHashMap::new));
3947
this.field = new PropertyField<>(name, entityClass);
4048
}
4149

0 commit comments

Comments
 (0)