コード例 #1
0
  private void gameUpdate() {

    for (Square square : squares) {
      Point pos = positionPuller.getSquarePosition(square);
      square.setPosition(pos);
    }
  }
コード例 #2
0
 public void testEmbeddableExplicitAccessStrategy() throws Exception {
   Square square = new Square();
   Position pos = new Position(10, 15);
   square.setPosition(pos);
   Session s = openSession();
   s.persist(square);
   Transaction tx = s.beginTransaction();
   tx.commit();
   s.clear();
   tx = s.beginTransaction();
   square = (Square) s.get(Square.class, square.getId());
   assertEquals(10, square.getPosition().x);
   try {
     square.getPosition().getX();
     fail();
   } catch (RuntimeException e) {
     // success
   }
   s.delete(square);
   tx.commit();
   s.close();
 }