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
 String naturalKey
          A single property that is a natural unique identifier for the bean.
 boolean readOnly
          When set to true the beans returned from a query will default to be readOnly.
 boolean useBeanCache
          When set to true the bean cache will be used unless explicitly stated not to in a query via Query.setUseCache(boolean).
 Query.UseIndex useIndex
          Default setting for using a text index if it has been defined on this bean type.
 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

naturalKey

public abstract String naturalKey
A single property that is a natural unique identifier for the bean.

When a findUnique query is used with this property as the sole expression then there will be a lookup into the L2 natural key cache.

Default:
""

readOnly

public abstract boolean readOnly
When set to true the beans returned from a query will default to be readOnly.

If the bean is readOnly and has no relationships then it may be sharable.

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:
""

useIndex

public abstract Query.UseIndex useIndex
Default setting for using a text index if it has been defined on this bean type.

Default:
com.avaje.ebean.Query.UseIndex.DEFAULT


Copyright © 2012. All Rights Reserved.