mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1297 - ENH: Add DtoQuery ... such that we can map native SQL queries automatically into "DTO beans"
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package io.ebeaninternal.server.dto;
|
||||
|
||||
import io.ebeaninternal.server.type.DataReader;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Plan based on mapping via single constructor only.
|
||||
*/
|
||||
class DtoQueryPlanConstructor extends DtoQueryPlanBase {
|
||||
|
||||
private final DtoMetaConstructor constructor;
|
||||
|
||||
DtoQueryPlanConstructor(DtoMappingRequest request, DtoMetaConstructor constructor) {
|
||||
super(request);
|
||||
this.constructor = constructor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object readRow(DataReader dataReader) throws SQLException {
|
||||
return constructor.process(dataReader);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user