I got a simple domain model:
public class Match {
private Long id;
private Team homeTeam;
private Team awayTeam;
private Day day;
// getter, setters, ...
}
And a rule (query) that checks if a team has 2 matches on the same day
(no matter if they are the home or the away team):
query "multipleMatchesPerTeamPerDay"
$team : Team();
Match($id : id, homeTeam == $team || awayTeam == $team, $day : day);
exists Match(id > $id, homeTeam == $team || awayTeam == $team, day
== $day);
end
But apparently I can't do this?
unknown:12:50 Unexpected token '=='
unknown:13:39 Unexpected token '$team'
unknown:13:57 Unexpected token '=='
unknown:18:33 Unexpected token 'day'
Line 12 is: Match($id : id, homeTeam == $team || awayTeam == $team, $day
: day);
Is there any way to avoid having to write a separate rule (query) for
every combination (home-home, away-home, home-away, away-away)?
Thanks for any help/advice.
--
With kind regards,
Geoffrey De Smet
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email