001package com.avaje.ebean.annotation;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * Specify cache tuning for query caching on a specific entity type.
010 * <p>
011 * If this is not specified then the system default settings are used.
012 * </p>
013 */
014@Target({ ElementType.TYPE })
015@Retention(RetentionPolicy.RUNTIME)
016public @interface CacheQueryTuning {
017
018  /**
019   * The maximum size for the cache.
020   * <p>
021   * This defaults to 0 which means unlimited.
022   * </p>
023   */
024  int maxSize() default 0;
025
026  /**
027   * The maximum time (in seconds) that a cache entry is allowed to stay in the
028   * cache when it has not been accessed.
029   * <p>
030   * This defaults to 0 which means unlimited.
031   * </p>
032   */
033  int maxIdleSecs() default 0;
034
035  /**
036   * The maximum time (in seconds) a cache entry is allowed to stay in the
037   * cache.
038   * <p>
039   * This is not generally required as the cache entries are automatically
040   * evicted when related data changes are committed.
041   * </p>
042   * <p>
043   * This defaults to 0 which means unlimited.
044   * </p>
045   */
046  int maxSecsToLive() default 0;
047
048  /**
049   * The frequency (in seconds) that cache trimming should occur.
050   * <p>
051   * This is a hint for cache implementations that use background cache trimming.
052   * </p>
053   */
054  int trimFrequency() default 0;
055}