Package org.newinstance.gucoach.model

Examples of org.newinstance.gucoach.model.Fixture


        teamService.insertTeams(newTeams);
        final List<Team> teams = teamService.findAllTeams();

        final List<Fixture> fixtures = new ArrayList<Fixture>();
        // Acapulco - Miami Beach 2:1
        final Fixture fixture1 = new Fixture();
        fixture1.setHomeTeam(teams.get(0));
        fixture1.setAwayTeam(teams.get(1));
        fixture1.setMatchDay(new Date());
        fixture1.setMatchResult("2:1");
        // Miami Beach - Varese 0:3
        final Fixture fixture2 = new Fixture();
        fixture2.setHomeTeam(teams.get(1));
        fixture2.setAwayTeam(teams.get(2));
        fixture2.setMatchDay(new Date());
        fixture2.setMatchResult("0:3");
        // Varese - Acapulco 1:1
        final Fixture fixture3 = new Fixture();
        fixture3.setHomeTeam(teams.get(2));
        fixture3.setAwayTeam(teams.get(0));
        fixture3.setMatchDay(new Date());
        fixture3.setMatchResult("1:1");

        fixtures.add(fixture1);
        fixtures.add(fixture2);
        fixtures.add(fixture3);
        fixtureService.insertFixtures(fixtures);
View Full Code Here


     * Creates and returns a new {@link Fixture} entity.
     *
     * @return a new entity
     */
    protected Fixture createFixture(final Team homeTeam, final Team awayTeam, final String result) {
        final Fixture fixture = new Fixture();
        fixture.setMatchDay(new Date());
        fixture.setHomeTeam(homeTeam);
        fixture.setAwayTeam(awayTeam);
        fixture.setMatchResult(result);
        return fixture;
    }
View Full Code Here

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);

        final Fixture fixture1 = createFixture(team1, team2, null);
        final Fixture fixture2 = createFixture(team2, team1, null);
        final List<Fixture> fixtures = new ArrayList<Fixture>();
        fixtures.add(fixture1);
        fixtures.add(fixture2);

        em.getTransaction().begin();
View Full Code Here

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);

        final Fixture fixture1 = createFixture(team1, team2, null);
        final List<Fixture> fixtures = new ArrayList<Fixture>();
        fixtures.add(fixture1);

        em.getTransaction().begin();
        teamService.insertTeams(teams);
        fixtureService.insertFixtures(fixtures);
        em.getTransaction().commit();

        // update fixture
        fixture1.setMatchResult("2:0");

        em.getTransaction().begin();
        fixtureService.updateFixture(fixture1);
        em.getTransaction().commit();
View Full Code Here

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);

        final Fixture fixture1 = createFixture(team1, team2, null);
        final Fixture fixture2 = createFixture(team2, team1, null);
        final List<Fixture> fixtures = new ArrayList<Fixture>();
        fixtures.add(fixture1);
        fixtures.add(fixture2);

        em.getTransaction().begin();
View Full Code Here

        final List<Team> teams = new ArrayList<Team>();
        teams.add(team1);
        teams.add(team2);

        final Fixture fixture1 = createFixture(team1, team2, null);
        final Fixture fixture2 = createFixture(team1, team2, null);
        final List<Fixture> fixtures = new ArrayList<Fixture>();
        fixtures.add(fixture1);
        fixtures.add(fixture2);

        em.getTransaction().begin();
View Full Code Here

TOP

Related Classes of org.newinstance.gucoach.model.Fixture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.