Skip to content

Commit 68b679c

Browse files
committed
Consider types from java and javax packages simple types.
For map repositories, we do not introspect Java platform types anymore. Closes #569
1 parent 14a8f70 commit 68b679c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/main/java/org/springframework/data/keyvalue/core/mapping/context/KeyValueMappingContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public KeyValueSimpleTypeHolder() {
100100
@Override
101101
public boolean isSimpleType(Class<?> type) {
102102

103-
if (type.getName().startsWith("java.math.") || type.getName().startsWith("java.util.")) {
103+
if (type.getName().startsWith("java.") || type.getName().startsWith("javax.")) {
104104
return true;
105105
}
106106

src/test/java/org/springframework/data/keyvalue/Person.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package org.springframework.data.keyvalue;
1717

18+
import java.net.URL;
19+
1820
import org.springframework.data.annotation.Id;
1921

2022
import com.querydsl.core.annotations.QueryEntity;
@@ -29,6 +31,7 @@ public class Person {
2931
private @Id String id;
3032
private String firstname;
3133
private int age;
34+
private URL homepage;
3235

3336
public Person(String firstname, int age) {
3437
super();
@@ -59,4 +62,12 @@ public void setFirstname(String firstname) {
5962
public void setAge(int age) {
6063
this.age = age;
6164
}
65+
66+
public URL getHomepage() {
67+
return homepage;
68+
}
69+
70+
public void setHomepage(URL homepage) {
71+
this.homepage = homepage;
72+
}
6273
}

0 commit comments

Comments
 (0)