git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application/perform-service@176425 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1eb4ba6a00
commit
0624deba6b
|
@ -4,9 +4,11 @@ import java.sql.ResultSet;
|
|||
import java.sql.SQLException;
|
||||
|
||||
import org.gcube.application.perform.service.engine.model.DBField;
|
||||
import org.gcube.application.perform.service.engine.model.DBField.ImportRoutine;
|
||||
import org.gcube.application.perform.service.engine.model.anagraphic.Batch;
|
||||
import org.gcube.application.perform.service.engine.model.anagraphic.Farm;
|
||||
import org.gcube.application.perform.service.engine.model.importer.ImportRoutineDescriptor;
|
||||
import org.gcube.application.perform.service.engine.model.importer.ImportStatus;
|
||||
|
||||
public class Queries {
|
||||
|
||||
|
@ -61,8 +63,26 @@ public class Queries {
|
|||
}
|
||||
|
||||
|
||||
public static ImportRoutineDescriptor rowToDescriptor(ResultSet rs) {
|
||||
throw new RuntimeException("IMPLEMENT THIS SHIT");
|
||||
public static ImportRoutineDescriptor rowToDescriptor(ResultSet rs) throws SQLException {
|
||||
ImportRoutineDescriptor toReturn=new ImportRoutineDescriptor();
|
||||
toReturn.setBatch_type(rs.getString(ImportRoutine.BATCH_TYPE));
|
||||
toReturn.setCaller(rs.getString(ImportRoutine.CALLER));
|
||||
toReturn.setComputationId(rs.getString(ImportRoutine.COMPUTATION_ID));
|
||||
toReturn.setComputationOperator(rs.getString(ImportRoutine.COMPUTATION_OPID));
|
||||
toReturn.setComputationOperatorName(rs.getString(ImportRoutine.COMPUTATION_OPNAME));
|
||||
toReturn.setComputationRequest(rs.getString(ImportRoutine.COMPUTATION_REQ));
|
||||
toReturn.setComputationUrl(rs.getString(ImportRoutine.COMPUTATION_URL));
|
||||
toReturn.setEndTime(rs.getTimestamp(ImportRoutine.END).toInstant());
|
||||
toReturn.setFarmId(rs.getLong(ImportRoutine.FARM_ID));
|
||||
toReturn.setId(rs.getLong(ImportRoutine.ID));
|
||||
|
||||
toReturn.setLock(rs.getString(ImportRoutine.LOCK));
|
||||
toReturn.setSourceUrl(rs.getString(ImportRoutine.SOURCE_URL));
|
||||
|
||||
toReturn.setSourceVersion(rs.getString(ImportRoutine.SOURCE_VERSION));
|
||||
toReturn.setStartTime(rs.getTimestamp(ImportRoutine.START).toInstant());
|
||||
toReturn.setStatus(ImportStatus.valueOf(rs.getString(ImportRoutine.STATUS)));
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,13 +21,13 @@ public class ImportRoutineDescriptor {
|
|||
private Long farmId;
|
||||
private String batch_type;
|
||||
private String sourceUrl;
|
||||
private Integer sourceVersion;
|
||||
private String sourceVersion;
|
||||
|
||||
private Instant startTime;
|
||||
private Instant endTime;
|
||||
|
||||
private String status;
|
||||
private String executionID;
|
||||
private ImportStatus status;
|
||||
private String lock;
|
||||
private String caller;
|
||||
|
||||
private String computationId;
|
||||
|
|
Loading…
Reference in New Issue