Have a problem trying to mapping a Object that extends from Arraylist into a Class that have a List, my code is:
public class ClassOne extends ArrayList<ClassTwo> {}
public class ClassTarget {
private String companyId;
private List<ObjectTarget> fieldListTarget;
}
When I declare the mapper the error is:
java: Can't generate mapping method from iterable type to non-iterable type.
I think that the error is in extends ArrayList<SomeObject>
I don´t know how can I mapping fields with this type of object.
Iterable
is an Interface, that a class can implement. An ArrayList
implements that, and with that indirectly also your class ClassOne
. Have you tried to change your class to
public class ClassTarget implements Iterable {
...
}
and implement the necessary methods?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.