@Test public void testInsert() { final ServerModel server1 = ServerModels.newServerModel(); final ServerModel server2 = ServerModels.newServerModel(); final List<ServerModel> servers = Lists.newArrayList(server1, server2); serverDao.insert(server1, server2); serverDao.insert(servers); for (final ServerModel server : servers) { final List<ServerModel> serverModels = query(server); Assert.assertTrue(serverModels.size() == 1); ServerModels.assertServer(server, serverModels.get(0)); server.setToken(ServerModels.newServerModel().getToken()); server.setOperatorId(ServerModels.newServerModel().getOperatorId()); } serverDao.insert(servers); for (final ServerModel server : servers) { final List<ServerModel> serverModels = query(server); Assert.assertTrue(serverModels.size() == 1); ServerModels.assertServer(server, serverModels.get(0)); } }
public void insert(final ServerModel... servers) { if ((servers == null) || (servers.length == 0)) { return; } this.insert(Lists.newArrayList(servers)); }
ServerDao { public void insert(final ServerModel... servers) { if ((servers == null) || (servers.length == 0)) { return; } this.insert(Lists.newArrayList(servers)); } }
ServerDao { public void insert(final ServerModel... servers) { if ((servers == null) || (servers.length == 0)) { return; } this.insert(Lists.newArrayList(servers)); } private  ServerDao(); }
ServerDao { public void insert(final ServerModel... servers) { if ((servers == null) || (servers.length == 0)) { return; } this.insert(Lists.newArrayList(servers)); } private  ServerDao(); List<ServerModel> queryServer(final String regionId, final String serverId); List<ServerModel> queryServers(final String regionId); List<ServerModel> queryServers(); List<ServerModel> query(final String condition, final String... args); void delete(final Long... ids); void delete(final ServerModel... servers); void delete(final List<ServerModel> serverList); void destroyServers(final List<ServerKey> serverKeys); void insert(final ServerModel... servers); void insert(final List<ServerModel> serverList); }
ServerDao { public void insert(final ServerModel... servers) { if ((servers == null) || (servers.length == 0)) { return; } this.insert(Lists.newArrayList(servers)); } private  ServerDao(); List<ServerModel> queryServer(final String regionId, final String serverId); List<ServerModel> queryServers(final String regionId); List<ServerModel> queryServers(); List<ServerModel> query(final String condition, final String... args); void delete(final Long... ids); void delete(final ServerModel... servers); void delete(final List<ServerModel> serverList); void destroyServers(final List<ServerKey> serverKeys); void insert(final ServerModel... servers); void insert(final List<ServerModel> serverList); static final ServerDao INSTANCE; }