try
{
// create a user object and persist it
UserEntity snazy = new UserEntity();
snazy.setUsername("snazy");
AddressType mainAddress = new AddressType(null, null, "Koeln", "Germany");
snazy.setMainAddress(mainAddress);
snazy.getOtherAddresses().put(AddressKind.HOME, mainAddress);
session.insert(snazy);
// now load the user object
UserEntity loaded = session.loadOne(UserEntity.class, "snazy");
System.out.printf("got user record for %s %n", loaded.getUsername());
//
//
//