File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed
main/java/org/springframework/data/util
test/java/org/springframework/data/util Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2011-2012 the original author or authors.
2
+ * Copyright 2011-2013 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -177,7 +177,7 @@ public TypeInformation<?> getProperty(String fieldname) {
177
177
}
178
178
179
179
String head = fieldname .substring (0 , separatorIndex );
180
- TypeInformation <?> info = fieldTypes . get (head );
180
+ TypeInformation <?> info = getProperty (head );
181
181
return info == null ? null : info .getProperty (fieldname .substring (separatorIndex + 1 ));
182
182
}
183
183
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2011 the original author or authors.
2
+ * Copyright 2011-2013 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -263,6 +263,20 @@ public void returnsComponentTypeForMultiDimensionalArrayCorrectly() {
263
263
assertThat (information .getActualType ().getActualType ().getType (), is ((Object ) String .class ));
264
264
}
265
265
266
+ /**
267
+ * @see DATACMNS-309
268
+ */
269
+ @ Test
270
+ @ SuppressWarnings ("rawtypes" )
271
+ public void findsGetterOnInterface () {
272
+
273
+ TypeInformation <Product > information = from (Product .class );
274
+ TypeInformation <?> categoryIdInfo = information .getProperty ("category.id" );
275
+
276
+ assertThat (categoryIdInfo , is (notNullValue ()));
277
+ assertThat (categoryIdInfo , is ((TypeInformation ) from (Long .class )));
278
+ }
279
+
266
280
static class StringMapContainer extends MapContainer <String > {
267
281
268
282
}
@@ -375,4 +389,13 @@ class StringImplementation implements GenericInterface<String> {
375
389
class LongImplementation implements GenericInterface <Long > {
376
390
377
391
}
392
+
393
+ interface Product {
394
+ Category getCategory ();
395
+ }
396
+
397
+ interface Category {
398
+
399
+ Long getId ();
400
+ }
378
401
}
You can’t perform that action at this time.
0 commit comments