@Test public void testFindNullEntry() { OAuthDomainEntry entry = sut.execute("tokenX"); assertTrue("Entry found for token of 'tokenX'", entry == null); }
@Override @SuppressWarnings("unchecked") public OAuthDomainEntry execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthDomainEntry e where e.token = :token").setParameter( "token", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthDomainEntry) results.get(0); }
GetOAuthEntry extends ReadMapper<String, OAuthDomainEntry> { @Override @SuppressWarnings("unchecked") public OAuthDomainEntry execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthDomainEntry e where e.token = :token").setParameter( "token", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthDomainEntry) results.get(0); } }
GetOAuthEntry extends ReadMapper<String, OAuthDomainEntry> { @Override @SuppressWarnings("unchecked") public OAuthDomainEntry execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthDomainEntry e where e.token = :token").setParameter( "token", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthDomainEntry) results.get(0); }  }
GetOAuthEntry extends ReadMapper<String, OAuthDomainEntry> { @Override @SuppressWarnings("unchecked") public OAuthDomainEntry execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthDomainEntry e where e.token = :token").setParameter( "token", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthDomainEntry) results.get(0); }  @Override @SuppressWarnings("unchecked") OAuthDomainEntry execute(final String inRequest); }
GetOAuthEntry extends ReadMapper<String, OAuthDomainEntry> { @Override @SuppressWarnings("unchecked") public OAuthDomainEntry execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthDomainEntry e where e.token = :token").setParameter( "token", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthDomainEntry) results.get(0); }  @Override @SuppressWarnings("unchecked") OAuthDomainEntry execute(final String inRequest);  }