コード例 #1
0
ファイル: SelectTests.java プロジェクト: nile/beankeeper
 public void testReservedTableOrderBy() throws Exception {
   // Drop the table
   removeAll(User.class);
   // Create
   User user = new User();
   user.setName("demon");
   getStore().save(user);
   User aUser = new User();
   aUser.setName("root");
   getStore().save(aUser);
   // Do query
   List result = getStore().find("find user order by user.name");
   Assert.assertEquals(result.size(), 2);
 }
コード例 #2
0
  private void read() {
    try {
      line = is.readLine();
      while (line.compareTo("QUIT") != 0) {
        // System.out.println("Response from Client  :  " + line);
        if (line.toLowerCase().contains("@101|")) {
          send("Got username");
          String name =
              line.substring(line.indexOf('|', 0) + 1, line.indexOf('|', line.indexOf('|', 0) + 1));
          user.setName(name);
          System.out.println("Got username = "******"IO Error/ Client " + line + " terminated abruptly");
    } catch (NullPointerException e) {
      line = this.getName(); // reused String line for getting thread name
      System.out.println("Client " + line + " Closed");
    }
  }