com.avaje.ebean.annotation
Annotation Type CacheStrategy


@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface CacheStrategy

Specify the default cache use specific entity type.


Optional Element Summary
 boolean readOnly
          When set to true the beans returned from the cache will be treated as readOnly (effectively immutable) and this means they can be safely shared by many users.
 boolean useBeanCache
          When set to true the bean cache will be used unless explicitly stated not to in a query via Query.setUseCache(boolean).
 String warmingQuery
          Specify a query that can be used to warm the cache.
 

useBeanCache

public abstract boolean useBeanCache
When set to true the bean cache will be used unless explicitly stated not to in a query via Query.setUseCache(boolean).

Default:
true

readOnly

public abstract boolean readOnly
When set to true the beans returned from the cache will be treated as readOnly (effectively immutable) and this means they can be safely shared by many users.

If this is false then a copy of the bean is given back to the application and so the application code that modify that bean.

If you try to modify a readOnly bean it will throw an IllegalStateException.

Default:
false

warmingQuery

public abstract String warmingQuery
Specify a query that can be used to warm the cache.

All the beans fetched by this query will be loaded into the bean cache and the query itself will be loaded into the query cache.

The warming query will typically be executed at startup time after a short delay (defaults to a 30 seconds delay).

Default:
""


Copyright © 2010. All Rights Reserved.