bobobear / lambdaj

Automatically exported from code.google.com/p/lambdaj
Apache License 2.0
0 stars 0 forks source link

how use Matchers.hasItems by lambdaj filter #75

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create java object,Car.java;Db.java;Person.java;Sale.java

my code:

List<Sale> sales2 = db.getSales();
List<Car> cars =select(db.getCars(),having(on(Car.class).getBrand(), 
equalTo("Ferrari")));   
List<Long> carIds = collect(cars, on(Car.class).getCarId()); 
sales2 = filter(having(on(Sale.class).getCarId(), Matchers.hasItems(carIds)), 
sales2);

What is the expected output? What do you see instead?
i want to find all sales of Ferrari,but sales2 size is zero

Original issue reported on code.google.com by LorenLov...@gmail.com on 15 Sep 2011 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by LorenLov...@gmail.com on 15 Sep 2011 at 2:13

Attachments: