Persisting a set of enum values

This was tricky. After you specify your bean's parameter varable:

private Set weekDays;


Annotate it using the following annotations:


@Extensions({ @Extension(vendorName = "datanucleus", key = "cache", value = "false"), @Extension(vendorName = "datanucleus", key = "cache-lazy-loading", value = "false") })
@Persistent(defaultFetchGroup = "true")


The cache related extensions will force your set to be fully loaded when the bean is looked up so it's not null when read after the bean being detached.





Comments

Popular posts from this blog

Hosting Apache Tapestry5.1 on GAE (Google App Engine)

Apache Tapestry PageActivationContext tutorial

Testing SOAP services using pingdom