Exemplo n.º 1
0
  public static void deleteStatic(IPlayer p) throws SQLException, LostUpdateException {
    int count = PlayerTDG.delete(p.getId(), p.getVersion());
    if (count == 0)
      throw new LostUpdateException("Lost Update deleting player with id " + p.getId());

    // We also delete the team and pilot!
    TeamTDG.deleteByPlayer(p.getId());
    PilotTDG.deleteByPlayer(p.getId());
  }
Exemplo n.º 2
0
 public static void insertStatic(IPlayer p) throws SQLException {
   PlayerTDG.insert(
       p.getId(),
       p.getVersion(),
       p.getFirstName(),
       p.getLastName(),
       p.getEmail(),
       p.getUser().getId());
 }
Exemplo n.º 3
0
 public static void updateStatic(IPlayer p) throws SQLException, LostUpdateException {
   int count =
       PlayerTDG.update(
           p.getId(),
           p.getVersion(),
           p.getFirstName(),
           p.getLastName(),
           p.getEmail(),
           p.getUser().getId());
   if (count == 0)
     throw new LostUpdateException("Lost Update editing player with id " + p.getId());
   p.setVersion(p.getVersion() + 1);
 }