public static EntityTeam createEntity(Team gitTeam, GenericDao dao) {
if (gitTeam == null) {
return null;
}
EntityTeam team = getTeamByTeamID(gitTeam.getId(), dao);
if (team == null) {
team = new EntityTeam();
}
team.setIdTeam(gitTeam.getId());
team.setMembersCount(gitTeam.getMembersCount());
team.setName(gitTeam.getName());
team.setPermission(gitTeam.getPermission());
team.setReposCount(gitTeam.getReposCount());
team.setUrl(gitTeam.getUrl());
if (team.getId() == null || team.getId().equals(0l)) {
dao.insert(team);
} else {
dao.edit(team);
}