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 11/*
2- * Copyright 2011-2012 the original author or authors.
2+ * Copyright 2011-2013 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -177,7 +177,7 @@ public TypeInformation<?> getProperty(String fieldname) {
177177 }
178178
179179 String head = fieldname .substring (0 , separatorIndex );
180- TypeInformation <?> info = fieldTypes . get (head );
180+ TypeInformation <?> info = getProperty (head );
181181 return info == null ? null : info .getProperty (fieldname .substring (separatorIndex + 1 ));
182182 }
183183
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2011 the original author or authors.
2+ * Copyright 2011-2013 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -263,6 +263,20 @@ public void returnsComponentTypeForMultiDimensionalArrayCorrectly() {
263263 assertThat (information .getActualType ().getActualType ().getType (), is ((Object ) String .class ));
264264 }
265265
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+
266280 static class StringMapContainer extends MapContainer <String > {
267281
268282 }
@@ -375,4 +389,13 @@ class StringImplementation implements GenericInterface<String> {
375389 class LongImplementation implements GenericInterface <Long > {
376390
377391 }
392+
393+ interface Product {
394+ Category getCategory ();
395+ }
396+
397+ interface Category {
398+
399+ Long getId ();
400+ }
378401}
You can’t perform that action at this time.
0 commit comments