【问题标题】:Filter Criteria by attribute with @Convert使用 @Convert 按属性过滤条件
【发布时间】:2018-05-10 09:10:12
【问题描述】:

我有一个带有字符串列表的简单类,该列表使用@Convert 转换为数据库中的一列,现在我正在尝试基于类型属性创建标准。

@Entity(name = "my_table")
public class MyTable implements Serializable {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  @Column
  @Convert(converter = StringListConverter.class)
  private List<String> type;
}

和标准: c2.add(Restrictions.ilike("type", matchValue, MatchMode.ANYWHERE));

但我得到了这个例外:

org.springframework.orm.jpa.JpaSystemException: Error attempting to apply AttributeConverter; nested exception is javax.persistence.PersistenceException: Error attempting to apply AttributeConverter

*所有条目都有一个值,我使用 psql db

【问题讨论】:

  • 您有什么解决方法吗?
  • 不 :( .......

标签: spring postgresql criteria hibernate-criteria


【解决方案1】:

目前还不能使用 Hibernate。

请查看错误单:https://hibernate.atlassian.net/browse/HHH-9991

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-03
    相关资源
    最近更新 更多