クラス CacheHint

java.lang.Object
すべての実装されたインタフェース:
java.io.Serializable, ASTNode

public class CacheHint
extends EQLHint
EQLの実行結果のキャッシュを行うヒント句です。 キャッシュのスコープ、キャッシュの有効期間(秒)を指定可能です。
CahceScopeがTRANSACTIONの場合は、同一トランザクション内のみ当該キャッシュが有効です。 CahceScopeがGLOBAL(デフォルト)の場合は、共有キャッシュとなります。 CahceScope.GLOBAL、CahceScope.GLOBAL_KEEP、CahceScope.GLOBAL_RELOADの場合は、有効期間(秒)を指定することが可能です。 有効期間(秒)未指定の場合は無期限(デフォルトは無期限に設定。ただし、バックエンドで利用しているCacheStoreの設定で有効期限を設定している場合は、その限り)となります。 CacheScope.GLOBAL利用する際は、Entity定義にてqueryCacheを有効化した上で、EQLのヒント句をつける必要があります。
EQLでの記述例:
select /*+ cache */ a, b from SampleEntity where c.x='hoge' and a=1 and b=15
や、
select /*+ cache(transaction) */ a, b from SampleEntity where c.x='hoge' and a=1 and b=15
や、
select /*+ cache(60) */ a, b from SampleEntity where c.x='hoge' and a=1 and b=15
select /*+ cache(keep, 60) */ a, b from SampleEntity where c.x='hoge' and a=1 and b=15
select /*+ cache(reload, 60) */ a, b from SampleEntity where c.x='hoge' and a=1 and b=15
関連項目:
直列化された形式
  • ネストされたクラスの概要

    ネストされたクラス 
    修飾子とタイプ クラス 説明
    static class  CacheHint.CacheScope
    キャッシュのスコープを表す列挙型です。
  • コンストラクタの概要

    コンストラクタ 
    コンストラクタ 説明
    CacheHint()  
    CacheHint​(CacheHint.CacheScope scope)  
    CacheHint​(CacheHint.CacheScope scope, int ttl)  
  • メソッドの概要

    修飾子とタイプ メソッド 説明
    ASTNode accept​(ASTTransformer transformer)  
    void accept​(HintVisitor visitor)  
    boolean equals​(java.lang.Object obj)  
    CacheHint.CacheScope getScope()  
    int getTTL()  
    int hashCode()  
    void setScope​(CacheHint.CacheScope scope)
    キャッシュのスコープを指定。
    void setTTL​(int ttl)
    CacheScope.GLOBALの場合のキャッシュの有効期間(秒)を指定。
    java.lang.String toString()  

    クラスから継承されたメソッド org.iplass.mtp.entity.query.hint.Hint

    externalHint

    クラスから継承されたメソッド java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    インタフェースから継承されたメソッド org.iplass.mtp.entity.query.ASTNode

    copy
  • コンストラクタの詳細

  • メソッドの詳細

    • getScope

      public CacheHint.CacheScope getScope()
    • setScope

      public void setScope​(CacheHint.CacheScope scope)
      キャッシュのスコープを指定。TRANSACTION or GLOBALを指定可能。 デフォルトはGLOBAL。
      パラメータ:
      scope -
    • getTTL

      public int getTTL()
    • setTTL

      public void setTTL​(int ttl)
      CacheScope.GLOBALの場合のキャッシュの有効期間(秒)を指定。 未指定、0以下の場合は無限。
      パラメータ:
      ttl -
    • accept

      public ASTNode accept​(ASTTransformer transformer)
    • accept

      public void accept​(HintVisitor visitor)
      定義:
      accept クラス内 Hint
    • hashCode

      public int hashCode()
      定義:
      hashCode インタフェース内 ASTNode
      オーバーライド:
      hashCode クラス内 java.lang.Object
    • equals

      public boolean equals​(java.lang.Object obj)
      定義:
      equals インタフェース内 ASTNode
      オーバーライド:
      equals クラス内 java.lang.Object
    • toString

      public java.lang.String toString()
      定義:
      toString インタフェース内 ASTNode
      オーバーライド:
      toString クラス内 java.lang.Object