// Path: src/test/java/com/github/arteam/jdit/domain/TeamSqlObject.java
// @RegisterRowMapper(PlayerSqlObject.PlayerMapper.class)
// public interface TeamSqlObject {
// 
//     @CreateSqlObject
//     PlayerSqlObject playerDao();
// 
//     @SqlUpdate("insert into teams(name, division) values (:name, :division)")
//     @GetGeneratedKeys
//     long createTeam(@Bind("name") String name, @Bind("division") Division division);
// 
//     @SqlUpdate("insert into roster(team_id, player_id) values (:team_id, :player_id)")
//     void addPlayerToTeam(@Bind("team_id") long teamId, @Bind("player_id") long playerId);
// 
//     @Transaction
//     default void addTeam(Team team, List<Player> players) {
//         long teamId = createTeam(team.name, team.division);
//         for (Player player : players) {
//             long playerId = playerDao().createPlayer(player);
//             addPlayerToTeam(teamId, playerId);
//         }
//     }
// 
//     @SqlQuery("select * from players p " +
//             "inner join roster r on r.player_id=p.id " +
//             "inner join teams t on r.team_id=t.id " +
//             "where t.name = :team_name " +
//             "order by p.last_name")
//     List<Player> getPlayers(@Bind("team_name") String teamName);
// }
// 
// Path: src/test/java/com/github/arteam/jdit/domain/entity/Division.java
// public enum Division {
//     PACIFIC,
//     CENTRAL,
//     METROPOLITAN,
//     ATLANTIC
// }
// 
// Path: src/test/java/com/github/arteam/jdit/domain/entity/Player.java
// public class Player {
// 
//     public final Optional<Long> id;
//     public final String firstName;
//     public final String lastName;
//     public final Date birthDate;
//     public final Optional<Integer> height;
//     public final Optional<Integer> weight;
// 
//     public Player(Optional<Long> id, String firstName, String lastName, Date birthDate,
//                   Optional<Integer> height, Optional<Integer> weight) {
//         this.id = id;
//         this.firstName = firstName;
//         this.lastName = lastName;
//         this.birthDate = birthDate;
//         this.height = height;
//         this.weight = weight;
//     }
// 
//     public Player(String firstName, String lastName, Date birthDate, int height, int weight) {
//         this(Optional.<Long>empty(), firstName, lastName, birthDate, Optional.of(height), Optional.of(weight));
//     }
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .omitNullValues()
//                 .add("id", id.orElse(null))
//                 .add("firstName", firstName)
//                 .add("lastName", lastName)
//                 .add("birthDate", birthDate)
//                 .add("height", height.orElse(null))
//                 .add("weight", weight.orElse(null))
//                 .toString();
//     }
// }
// 
// Path: src/test/java/com/github/arteam/jdit/domain/entity/Team.java
// public class Team {
// 
//     public final Optional<Long> id;
//     public final String name;
//     public final Division division;
// 
//     public Team(Optional<Long> id, String name, Division division) {
//         this.id = id;
//         this.name = name;
//         this.division = division;
//     }
// 
//     public Team(String name, Division division) {
//         this.name = name;
//         this.division = division;
//         this.id = Optional.empty();
//     }
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .add("id", id)
//                 .add("name", name)
//                 .add("division", division)
//                 .toString();
//     }
// }


import com.github.arteam.jdit.annotations.DataSet;
import com.github.arteam.jdit.annotations.TestedSqlObject;
import com.github.arteam.jdit.domain.TeamSqlObject;
import com.github.arteam.jdit.domain.entity.Division;
import com.github.arteam.jdit.domain.entity.Player;
import com.github.arteam.jdit.domain.entity.Team;
import com.google.common.collect.ImmutableList;
import org.joda.time.format.ISODateTimeFormat;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.Date;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
package com.github.arteam.jdit;




@RunWith(DBIRunner.class)
@DataSet("teamDao/insert-divisions.sql")
public class DBIComplexSqlObjectTest {

    @TestedSqlObject
// Path: src/test/java/com/github/arteam/jdit/domain/TeamSqlObject.java
// @RegisterRowMapper(PlayerSqlObject.PlayerMapper.class)
// public interface TeamSqlObject {
// 
//     @CreateSqlObject
//     PlayerSqlObject playerDao();
// 
//     @SqlUpdate("insert into teams(name, division) values (:name, :division)")
//     @GetGeneratedKeys
//     long createTeam(@Bind("name") String name, @Bind("division") Division division);
// 
//     @SqlUpdate("insert into roster(team_id, player_id) values (:team_id, :player_id)")
//     void addPlayerToTeam(@Bind("team_id") long teamId, @Bind("player_id") long playerId);
// 
//     @Transaction
//     default void addTeam(Team team, List<Player> players) {
//         long teamId = createTeam(team.name, team.division);
//         for (Player player : players) {
//             long playerId = playerDao().createPlayer(player);
//             addPlayerToTeam(teamId, playerId);
//         }
//     }
// 
//     @SqlQuery("select * from players p " +
//             "inner join roster r on r.player_id=p.id " +
//             "inner join teams t on r.team_id=t.id " +
//             "where t.name = :team_name " +
//             "order by p.last_name")
//     List<Player> getPlayers(@Bind("team_name") String teamName);
// }
// 
// Path: src/test/java/com/github/arteam/jdit/domain/entity/Division.java
// public enum Division {
//     PACIFIC,
//     CENTRAL,
//     METROPOLITAN,
//     ATLANTIC
// }
// 
// Path: src/test/java/com/github/arteam/jdit/domain/entity/Player.java
// public class Player {
// 
//     public final Optional<Long> id;
//     public final String firstName;
//     public final String lastName;
//     public final Date birthDate;
//     public final Optional<Integer> height;
//     public final Optional<Integer> weight;
// 
//     public Player(Optional<Long> id, String firstName, String lastName, Date birthDate,
//                   Optional<Integer> height, Optional<Integer> weight) {
//         this.id = id;
//         this.firstName = firstName;
//         this.lastName = lastName;
//         this.birthDate = birthDate;
//         this.height = height;
//         this.weight = weight;
//     }
// 
//     public Player(String firstName, String lastName, Date birthDate, int height, int weight) {
//         this(Optional.<Long>empty(), firstName, lastName, birthDate, Optional.of(height), Optional.of(weight));
//     }
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .omitNullValues()
//                 .add("id", id.orElse(null))
//                 .add("firstName", firstName)
//                 .add("lastName", lastName)
//                 .add("birthDate", birthDate)
//                 .add("height", height.orElse(null))
//                 .add("weight", weight.orElse(null))
//                 .toString();
//     }
// }
// 
// Path: src/test/java/com/github/arteam/jdit/domain/entity/Team.java
// public class Team {
// 
//     public final Optional<Long> id;
//     public final String name;
//     public final Division division;
// 
//     public Team(Optional<Long> id, String name, Division division) {
//         this.id = id;
//         this.name = name;
//         this.division = division;
//     }
// 
//     public Team(String name, Division division) {
//         this.name = name;
//         this.division = division;
//         this.id = Optional.empty();
//     }
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .add("id", id)
//                 .add("name", name)
//                 .add("division", division)
//                 .toString();
//     }
// }


// Path: src/test/java/com/github/arteam/jdit/DBIComplexSqlObjectTest.java
import com.github.arteam.jdit.annotations.DataSet;
import com.github.arteam.jdit.annotations.TestedSqlObject;
import com.github.arteam.jdit.domain.TeamSqlObject;
import com.github.arteam.jdit.domain.entity.Division;
import com.github.arteam.jdit.domain.entity.Player;
import com.github.arteam.jdit.domain.entity.Team;
import com.google.common.collect.ImmutableList;
import org.joda.time.format.ISODateTimeFormat;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.Date;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;

package com.github.arteam.jdit;




@RunWith(DBIRunner.class)
@DataSet("teamDao/insert-divisions.sql")
public class DBIComplexSqlObjectTest {

    @TestedSqlObject
    TeamSqlObject teamSqlObject;