예제 #1
0
  @Override
  public Set<HomeInvite> findInvitesByHome(Home home) {
    String q = "find homeInvite where home = :home";
    Query<HomeInvite> query = ebean.createQuery(HomeInvite.class, q);
    query.setParameter("home", home.getId());

    return query.findSet();
  }
예제 #2
0
  @Override
  public HomeInvite findInviteByHomeAndInvitee(Home home, String invitee) {
    String q;
    if (configCore.useEbeanSearchLower())
      q = "find homeInvite where home = :home and lower(invitedPlayer) = lower(:invitee)";
    else q = "find homeInvite where home = :home and invitedPlayer = :invitee";

    Query<HomeInvite> query = ebean.createQuery(HomeInvite.class, q);
    query.setParameter("home", home.getId());
    query.setParameter("invitee", invitee);

    return query.findUnique();
  }