SpiEbeanServer server = (SpiEbeanServer)Ebean.getServer(null);
BeanDescriptor<DPerson> descriptor = server.getBeanDescriptor(DPerson.class);
ElPropertyValue elCmoney = descriptor.getElGetValue("cmoney");
// ElPropertyValue elCmoneyAmt = descriptor.getElGetValue("cmoney.amount");
// ElPropertyValue elCmoneyCur = descriptor.getElGetValue("cmoney.currency");
JsonContext jsonContext = server.json();
String json = jsonContext.toJson(p);
DPerson bean = jsonContext.toBean(DPerson.class, json);
Assert.assertEquals("first", bean.getFirstName());
Assert.assertEquals(new Money("12200"), bean.getSalary());
Assert.assertEquals(new Money("12"), bean.getCmoney().getAmount());
Assert.assertEquals(NZD, bean.getCmoney().getCurrency());
EntityBean entityBean = (EntityBean)p;
Object cmoney = elCmoney.elGetValue(entityBean);
// Object amt = elCmoneyAmt.elGetValue(entityBean);
// Object cur = elCmoneyCur.elGetValue(entityBean);
Assert.assertNotNull(cmoney);
// Assert.assertEquals(new Money("12"), amt);