// 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