您好我正在尝试查询以选择我的实体:
这是我的Lot实体
@EmbeddedId
@AttributeOverrides({ @AttributeOverride(name = "idLot", column = @Column(name = "id_lot", nullable = false)),
@AttributeOverride(name = "versionLot", column = @Column(name = "version_lot", nullable = false, length = 10)) })
public LotId getId() {
return this.id;
}
...
复合ID
@Embeddable
public class LotId implements java.io.Serializable {
private int idLot;
private int versionLot;
...
和我的查询
public List<Lot> findTopById_VersionLotAndId_IdLot(@Param("identifiant") int idLot);
给了我
Caused by: java.lang.IllegalArgumentException: No parameter available for part id SIMPLE_PROPERTY (1): [Is, Equals] NEVER.
答案 0 :(得分:0)
这样做了伎俩
Optional<Lot> findTopById_IdLotOrderById_VersionLotDesc(@Param("identifiant") int idIdLot);