@Mapper
public interface MyMapper {
public MyVO mapEntityToVO(MyEntity entity); // WORKS
public ArrayList<MyVO> mapEntityListToVOList(List<MyEntity> entities); // WORKS
public MyVO mapEntityToVO(MyEntity entity, MySecondSource source); // WORKS
public ArrayList<MyVO> mapEntityListToVOList(List<MyEntity> entities, MySecondSource source); // DOESN'T WORK (it produces empty list)
}
实施地图绘制程序的产出如下:
代码语言:
javascript
复制
public class MyMapperImpl implements MyMapper {
[...]
@Override
public ArrayList<MyVO> mapEntityListToVOList(List<MyEntity> entities) {
if ( entities == null ) {
return null;
ArrayList<MyVO> list = new ArrayList<MyVO>( entity.size() );
for ( MyEntity entity : entities ) {
list.add( mapEntityToVO ( entity ) );
return list;
[...]
@Override
public ArrayList<MyVO> mapEntityListToVOList(List<MyEntity> entities, MySecondSource source) {
if ( entities == null && source == null) {
return null;
ArrayList<MyVO> arrayList = new ArrayList<MyVO>();