通过@convert属性进行过滤标准



我有一个带有字符串列表的简单类,并且此列表被转换为@convert的DB中的一个列,现在我试图基于类型的attrbute创建一个标准。

@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

现在不可能使用Hibernate。

请参阅错误票:https://hibernate.atlassian.net/browse/HHH--9991

最新更新