--
You received this message because you are subscribed to the Google Groups "objectify-appengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appen...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appengine+unsub...@googlegroups.com.
>>>> an email to objectify-appengine+unsub...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
> --
> You received this message because you are subscribed to the Google Groups
> "objectify-appengine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to objectify-appengine+unsub...@googlegroups.com.
Hi Jeff,I did just what you suggested. I used the static method:
JodaMoneyTranslators.add(ObjectifyService.factory());to register Joda translators in a class that implements ServletContextListener, the same place where I register all my entities. Then I have some Money fields in my entities without any annotation. I am able to save the entities in the datastore, but when I try to retrieve the entities from the datastore, I get the error message org.joda.money/Money must have a no-arg constructor.
Am I missing something?
Thanks.
JodaMoneyTranslators.add(ObjectifyService.factory());
to register Joda translators in a class that implements ServletContextListener, the same place where I register all my entities. Then I have some Money fields in my entities without any annotation. I am able to save the entities in the datastore, but when I try to retrieve the entities from the datastore, I get the error message org.joda.money/Money must have a no-arg constructor.
Am I missing something?
Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appen...@googlegroups.com.
import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.impl.translate.opt.joda.JodaMoneyTranslators;
public class OfyHelper implements ServletContextListener {
@Override
public void contextDestroyed(ServletContextEvent arg0) {
}
@Override
public void contextInitialized(ServletContextEvent arg0) {
// This will be invoked as part of a warmup request, or the first user
// request if no warmup request was invoked
ObjectifyService.register(FinancialInstitution.class);
ObjectifyService.register(AccountHolder.class);
ObjectifyService.register(Account.class);
ObjectifyService.register(AccountHTG.class);
ObjectifyService.register(AccountUSD.class);
ObjectifyService.register(Card.class);
ObjectifyService.register(Merchant.class);
ObjectifyService.register(LedgerEntry.class);
ObjectifyService.register(Transaction.class);
JodaMoneyTranslators.add(ObjectifyService.factory());
}
}