
org.sfm.querydsl.QueryDslMappingProjection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simpleFlatMapper Show documentation
Show all versions of simpleFlatMapper Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.sfm.querydsl;
import com.mysema.query.Tuple;
import com.mysema.query.types.Expression;
import com.mysema.query.types.MappingProjection;
import org.sfm.map.Mapper;
public class QueryDslMappingProjection extends MappingProjection {
/**
*
*/
private static final long serialVersionUID = -9015755919878465141L;
private final Mapper mapper;
public QueryDslMappingProjection(Class type, Expression>... args) {
super(type, args);
QueryDslMapperBuilder builder =new QueryDslMapperBuilder(type);
for(int i = 0; i < args.length; i++) {
builder.addMapping(args[i], i);
}
mapper = builder.mapper();
}
@Override
protected T map(Tuple row) {
return mapper.map(row);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy