Open ParthaNath28 opened 2 years ago
@Embeddable public class EmployeeId implements Serializable {
@Column(name = "company_id")
private Long companyId;
@Column(name = "employee_number")
private Long employeeNumber;
}
@Entity(name = "Employee") @Table(name = "employee") public class EmployeeEntity {
@EmbeddedId
private EmployeeId id;
private String name;
}
There can be scenario that distinct employees might not be identified by their employee id but a composite id needs be used with a combination of employee id and company id. However I might functionality to find all employees having employee number 12345. Had it been a linear Entity class structure the jpaStreamer code might have looked liked the following.
final List
Hello
As discussed in the Gitter Channel I would like to know the syntax to be used while working entity classes having @EmbeddedId composite key based objects.
jpaStreamer.stream(MyOwnEntity.class) .filter(MyOwnEntity$.<do I put property of nested composite key object ?>.equalIgnoreCase("filterIdentifier"))