public interface InventoryRepository extends JPARepository<Inventory, Long> {
List<Inventory> findByIdIn(List<Long> ids);
}
Above is working fine, however in same way I am trying to fetch the List or Map, based on multiple params List ids and List sortNumber.
I would be also happy with return type Map from the method.
I came up with below things, which isn't correct.
List<Inventory> findByIdANDSortNumberIn(List<Long> ids, List<Long> sortNumbers);
Should do it with help of Criteria ? Is there any better way to do it?
Entity :
@Entity
@Table(name = Constants.T_INVENTROTY)
@Data
public class Inventory implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = Constants.COLUMN_IN_DM)
private Long id;
@Column(name = Constants.COLUMN_PROD_DESCRIPTION)
private String prodDescription;
@Column(name = Constants.COLUMN_PROD_DESCRIPTION)
private Long sortNumber;
@Column(name = Constants.COLUMN_QUANTITY)
private long quantity
}