he añadido la siguiente anotación para permitir caché a una de mis entidades EJB3, para probar el almacenamiento en caché con Ehcache, donde uso de Hibernate como el proveedor de persistencia:anotación @Cache error de uso
....
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 {
.....
}
que añadió lo siguiente a persistence.xml:
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/>
<property name="hibernate.cache.provider_configuration_file_resource_path" value="/ehcache.xml"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
Y cuando intento compilar me sale el siguiente error:
/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 (http://java.sun.com/webapps/bugreport) 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
¿Alguien me puede ayudar aquí y decirme lo que tengo que hacer o estoy haciendo mal actualmente?
Teniendo en cuenta que, usted debe aceptar su respuesta por lo que esta cuestión está cerrada. – sharakan
Dado que, también debe mencionar las dependencias que faltan en su respuesta –