/** * {@inheritDoc} */ @Override public JmxDefinitionDataIdent load(Long id) { return getEntityManager().find(JmxDefinitionDataIdent.class, id); }
/** * {@inheritDoc} */ @Override public List<Long> findIdForPlatformIdent(long platformId, JmxDefinitionDataIdent jmxDefinitionDataIdentExample, boolean updateTimestamp) { TypedQuery<Long> query = getEntityManager().createNamedQuery(JmxDefinitionDataIdent.FIND_ID_BY_PLATFORM_AND_EXAMPLE, Long.class); query.setParameter("platformIdentId", platformId); query.setParameter("mBeanObjectName", jmxDefinitionDataIdentExample.getmBeanObjectName()); query.setParameter("mBeanAttributeName", jmxDefinitionDataIdentExample.getmBeanAttributeName()); List<Long> resultList = query.getResultList(); if (updateTimestamp && CollectionUtils.isNotEmpty(resultList)) { Query updateQuery = getEntityManager().createNamedQuery(JmxDefinitionDataIdent.UPDATE_TIMESTAMP); updateQuery.setParameter("ids", resultList); updateQuery.executeUpdate(); } return resultList; } }