* {@inheritDoc}
*/
@Override
public MFramework findFramework(Connection conn) {
LOG.debug("Looking up framework metadata");
MFramework mf = null;
PreparedStatement formFetchStmt = null;
PreparedStatement inputFetchStmt = null;
try {
formFetchStmt = conn.prepareStatement(STMT_FETCH_FORM_FRAMEWORK);
inputFetchStmt = conn.prepareStatement(STMT_FETCH_INPUT);
List<MForm> connectionForms = new ArrayList<MForm>();
Map<MJob.Type, List<MForm>> jobForms =
new HashMap<MJob.Type, List<MForm>>();
loadForms(connectionForms, jobForms, formFetchStmt, inputFetchStmt, 1);
// Return nothing If there aren't any framework metadata
if(connectionForms.isEmpty() && jobForms.isEmpty()) {
return null;
}
mf = new MFramework(new MConnectionForms(connectionForms),
convertToJobList(jobForms), detectFrameworkVersion(conn));
// We're using hardcoded value for framework metadata as they are
// represented as NULL in the database.
mf.setPersistenceId(1);
} catch (SQLException ex) {
throw new SqoopException(DerbyRepoError.DERBYREPO_0004,
"Framework metadata", ex);
} finally {