Disable caching in JPA (eclipselink)

前端 未结 8 1332
失恋的感觉
失恋的感觉 2020-11-29 02:09

I want to use JPA (eclipselink) to get data from my database. The database is changed by a number of other sources and I therefore want to go back to the database for every

8条回答
  •  醉酒成梦
    2020-11-29 02:35

    If you wish to disable caching without getting vendor specific, you could annotate your domain object with:

    @Cacheable(false)
    

    Here is an example:

    @Entity
    @Table(name="SomeEntity")
    @Cacheable(false)
    public class SomeEntity {
        // ...
    }
    

提交回复
热议问题