0

在 JPA 中,我可以将 *pattern_value* 与MEMBER OF一起使用吗?

WHERE '%abc_' MEMBER OF e.keywords

这里引用了 SPEC,我不认为它是用英文写的。:)

collection_member_expression ::=
    entity_or_value_expression [NOT] MEMBER [OF] collection_valued_path_expression
entity_or_value_expression ::=
    single_valued_object_path_expression |
    state_field_path_expression |
    simple_entity_or_value_expression
simple_entity_or_value_expression ::=
    identification_variable |
    input_parameter |
    literal
4

1 回答 1

1

MEMBER OF 是一种旧的 JPQL 语法,我只会使用 JOIN 或子选择,因为它们更清晰。

Select e from Employee e join e.keywords k where k like '%abc'
于 2012-05-29T12:33:41.477 回答