result.setType(theInstanceType);
findByPKQueryOperation.setResult(result);
findByPKQueryOperation.setQueryHandler(nqh1);
for (Iterator j = desc.getPrimaryKeyFields().iterator(); j.hasNext();) {
DatabaseField field = (DatabaseField)j.next();
Parameter p = new Parameter();
p.setName(field.getName().toLowerCase());
p.setType(getXMLTypeFromJDBCType(field.getSqlType()));
findByPKQueryOperation.getParameters().add(p);
}
xrServiceModel.getOperations().put(findByPKQueryOperation.getName(), findByPKQueryOperation);
QueryOperation findAllOperation = new QueryOperation();
findAllOperation.setName(FINDALL_QUERYNAME + "_" + tablenameAlias);
findAllOperation.setUserDefined(false);
NamedQueryHandler nqh2 = new NamedQueryHandler();
nqh2.setName(FINDALL_QUERYNAME);
nqh2.setDescriptor(tablenameAlias);
Result result2 = new CollectionResult();
result2.setType(theInstanceType);
findAllOperation.setResult(result2);
findAllOperation.setQueryHandler(nqh2);
xrServiceModel.getOperations().put(findAllOperation.getName(), findAllOperation);
InsertOperation insertOperation = new InsertOperation();
insertOperation.setName(CREATE_OPERATION_NAME + "_" + tablenameAlias);
Parameter theInstance = new Parameter();
theInstance.setName(THE_INSTANCE_NAME);
theInstance.setType(theInstanceType);
insertOperation.getParameters().add(theInstance);
xrServiceModel.getOperations().put(insertOperation.getName(), insertOperation);
UpdateOperation updateOperation = new UpdateOperation();
updateOperation.setName(UPDATE_OPERATION_NAME + "_" + tablenameAlias);
updateOperation.getParameters().add(theInstance);
xrServiceModel.getOperations().put(updateOperation.getName(), updateOperation);
DeleteOperation deleteOperation = new DeleteOperation();
deleteOperation.setName(REMOVE_OPERATION_NAME + "_" + tablenameAlias);
deleteOperation.setDescriptorName(tablenameAlias);
for (Iterator j = desc.getPrimaryKeyFields().iterator(); j.hasNext();) {
DatabaseField field = (DatabaseField)j.next();
Parameter p = new Parameter();
p.setName(field.getName().toLowerCase());
p.setType(getXMLTypeFromJDBCType(field.getSqlType()));
deleteOperation.getParameters().add(p);
}
xrServiceModel.getOperations().put(deleteOperation.getName(), deleteOperation);
}
}