DoydoQuery v2
English
English
  • Introduction
  • Quickstart
  • API
    • CRUD
    • Association Service
  • Complex Query
  • Object Concepts
    • Query Object
      • PageQuery
      • Predicate-Suffix Field
      • Logic-Suffix Field
      • Subquery Field
      • E-R Query Field
      • Custom Condition Field
    • Entity Object
      • Enum Column
      • Foreign Key
    • Patch Object
    • View Object
      • Column Mapping
      • Natural Join
  • Having Object
  • Advanced
    • Dialect
    • Pessimistic lock
  • Optimistic Lock
  • Web
    • Configuration
    • Controller
    • Service
    • Cache
    • Sorting
    • Validation
    • User ID injection
Powered by GitBook
On this page
  • Configuration
  • Programmatic

Was this helpful?

  1. Web

Cache

There are two ways to enable caching for target entities.

Configuration

Specify their class names using the doyto.query.caches property in the application.yaml file:

doyto:
  query:
    caches: UserEntity, MenuEntity

Programmatic

Override method getCacheName() in AbstractDynamicService:

public class UserService extends AbstractCrudService<UserEntity, Integer, UserQuery> {
    @Override
    protected String getCacheName() {
        return "module:user"; // return any string except UserEntity 
    }
}

PreviousServiceNextSorting

Last updated 16 days ago

Was this helpful?