我有一个 JsonIgnore 问题我正在考虑构建一个具有 JsonIgnore 注释的对象和一个没有它的对象。当我尝试使用新对象时,它仍在使用旧对象 - 我错过了什么?
这是新代码(CategoryIgnoreJson 是我创建的新类)
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("getCategoriesQandA")
public List<CategoryIgnoreJson> getCategoriesQandA() {
ediUtils = new EDIUtils(SYSTEM_NAME, USER_NAME);
Init(ediUtils);
ediUtils.writeToLog("get Categories , questions and answers ");
List<CategoryIgnoreJson> categoriesArray;
categoriesArray = categoryIgnoreJsonRepository.getEffective();
return categoriesArray;
}
我还创建了新的存储库
public interface CategoryIgnoreJsonRepository extends JpaRepository<CategoryIgnoreJson, Long>{
@Transactional
@Modifying
@Query("update Category set expiration_date = current_date() where category_id = ?1 ")
void expireCategory(Long id );
@Query("from Category where function ('coalesce' ,effectiveDate ,current_date() ) <= current_date() "
+ "and function('coalesce' ,expirationDate , to_date('50001231','yyyymmdd')) > current_date() ")
List<CategoryIgnoreJson> getEffective( );
}
我可以在日志文件中看到旧的类别仍然被称为我还将旧类别中的表名从类别更改为类别 1(只是为了验证此代码被调用)并得到预期的错误
edi_ms.categories1" does not exist
我如何称呼新班级?我错过了什么?
慕哥9229398
相关分类