Skip to content

Instantly share code, notes, and snippets.

/.java Secret

Created August 3, 2015 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/a6126ff4897d41b7b40c to your computer and use it in GitHub Desktop.
Save anonymous/a6126ff4897d41b7b40c to your computer and use it in GitHub Desktop.
public void showCustomerList() {
AnnotationConfiguration configuration =
new AnnotationConfiguration("HibersapSessionManager");
SessionManager sessionManager = configuration.buildSessionManager();
Session session = sessionManager.openSession();
try {
GetCustomerList bapi = new GetCustomerList(50);
session.execute(bapi);
printCustomerData(bapi);
} finally {
session.close();
}
}
private void printCustomerData(final GetCustomerList bapi) {
LOG.debug("Customer:");
List<Customer> customers = bapi.getCustomers();
for (Customer customer: customers) {
LOG.debug(customer.getNumber() + "\t" + customer.getName());
}
LOG.debug("Return:");
List<BapiRet2> returnValues = bapi.getReturnValues();
for (BapiRet2 value: returnValues) {
LOG.debug(value.getMessage() + "\t"
+ value.getNumber() + "\t"
+ value.getType() + "\t"
+ value.getId());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment