0 Replies Latest reply on Sep 13, 2006 3:07 AM by vberetti

    @Cache on Entity Bean and complex select queries.

    vberetti

      Hi,
      I annotated my Entity Beans with the
      @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
      and I'd like to know how object are really cached.
      In the jboss ejb3 documentation at http://docs.jboss.org/ejb3/app-server/tutorial/clusteredentity/clusteredentity.html it is said that :
      "Any attempt to look up Customer or Contact by their primary key, will first attempt to read the entry from the cache. If it cannot be found it will load it up from the database."
      So it seems to me that the cache only handle queries by primary keys.
      What happens if I try to get Customer by his age and his name ? Will it use this second level cache or will it in fact act just as if I did not defined "@Cache" annotation on the Customer Entity Bean ?
      Thanks,
      Vincent.