securis/src/main/java/net/curisit/securis/db/License.java
.. .. @@ -384,6 +384,17 @@ 384 384 } 385 385 } 386 386 387 + public static License findLicenseByCode(String code, EntityManager em) throws SeCurisServiceException {388 + TypedQuery<License> query = em.createNamedQuery("license-by-code", License.class);389 + query.setParameter("code", code);390 + try {391 + return query.getSingleResult();392 + } catch (NoResultException e) {393 + // There is no license for request data394 + return null;395 + }396 + }397 +387 398 public Integer getCodeSuffix() { 388 399 return codeSuffix; 389 400 }