I have two classes, user and car. Both have ManyToMany mapping to each other.
User:
@Entity
public class User extends Model {
private int year;
Check similar question (and answer)
Most probably your finder should look like:
public List<Car> findCars(int year, User user) {
return find.where().eq("year", year).eq("users.id", user.id).findList();
}
BTW I assume that you have some id
field but just didn't show us. Also make your fields public, so you won't need to write getters/setters for each.