【发布时间】:2019-03-04 15:34:10
【问题描述】:
我想缓存Interface-based Projections的结果
但我收到了这个错误
原因: com.hazelcast.nio.serialization.HazelcastSerializationException: 无法序列化“java.util.ArrayList”
@Repository
public interface CustomerRepository extends JpaRepository<CustomerRepository, Long> {
@Cacheable(value = "customer")
@Query("select c.first_name as firstName from customer where customer_id in :customerId")
List<NamesOnly> findByCustomerId( @Param("customerId") List<String> customerId);
}
public interface NamesOnly extends Serializable {
String getCustomerFirstName();
}
似乎扩展 Serializable 不起作用
【问题讨论】:
-
没有
@Cacheable是否可以工作?NamesOnly没有字段 -
确保它在没有
@Cacheable的情况下也能正常工作 -
好的,让我深入检查一下
标签: java spring-data-jpa hazelcast projection