Note that there are some explanatory texts on larger screens.

plurals
  1. PO@Cache annotation usage error
    primarykey
    data
    text
    <p>I added the following annotation to enable cache to one of my EJB3 entities, to test caching with ehCache, where I use Hibernate as the persistence provider:</p> <pre><code>.... import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; @Entity @Table(name = "F") @Cache(usage=CacheConcurrencyStrategy.READ_WRITE) @NamedQueries({ @NamedQuery(name = "F.findAll", query = "SELECT f FROM F f")}) public class F implements Serializable { ..... } </code></pre> <p>I added the following to persistence.xml:</p> <pre><code>&lt;property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/&gt; &lt;property name="hibernate.cache.provider_configuration_file_resource_path" value="/ehcache.xml"/&gt; &lt;property name="hibernate.cache.use_second_level_cache" value="true"/&gt; </code></pre> <p>And when I try to compile I get the following error: </p> <blockquote> <p>/persistence/F.class): warning: Cannot find annotation method 'usage()' in type 'org.hibernate.annotations.Cache': class file for org.hibernate.annotations.Cache not found An exception has occurred in the compiler (1.6.0_16). Please file a bug at the Java Developer Connection (<a href="http://java.sun.com/webapps/bugreport" rel="noreferrer">http://java.sun.com/webapps/bugreport</a>) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.hibernate.annotations.CacheConcurrencyStrategy not found</p> </blockquote> <p>Can anyone help me out here and let me know what I need to do or am doing wrong currently ? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload