World.java 459 B

1234567891011121314151617181920212223
  1. package models;
  2. import javax.persistence.*;
  3. import play.db.jpa.JPA;
  4. @Entity
  5. public class World {
  6. @Id
  7. public Long id;
  8. @Column(name = "randomNumber")
  9. public Long randomNumber;
  10. public static World findById(final Long id) throws Throwable {
  11. return JPA.withTransaction("default", true, new play.libs.F.Function0<World>() {
  12. public World apply() {
  13. return JPA.em().find(World.class, id);
  14. }
  15. });
  16. }
  17. }