protected void setUpFeatureOfInterestTypesForOffering(OfferingEntity offering, SosObservationOffering sosOffering) { sosOffering.setFeatureOfInterestTypes(toStringSet(offering.getFeatureTypes())); }
/** * Query allowed FeatureOfInterestTypes for offering * * @param offeringIdentifier * Offering identifier * @param session * Hibernate session * @return Allowed FeatureOfInterestTypes */ public List<String> getAllowedFeatureOfInterestTypes(String offeringIdentifier, Session session) { if (HibernateHelper.isEntitySupported(OfferingEntity.class)) { Criteria criteria = getDefaultTransactionalCriteria(session) .add(Restrictions.eq(OfferingEntity.IDENTIFIER, offeringIdentifier)); LOGGER.debug("QUERY getAllowedFeatureOfInterestTypes(offering): {}", HibernateHelper.getSqlString(criteria)); OfferingEntity offering = (OfferingEntity) criteria.uniqueResult(); if (offering != null) { List<String> list = Lists.newArrayList(); for (FormatEntity featureOfInterestType : offering.getFeatureTypes()) { list.add(featureOfInterestType.getFormat()); } return list; } } return Lists.newArrayList(); }
/** * Query allowed FeatureOfInterestTypes for offering * * @param offeringIdentifier * Offering identifier * @param session * Hibernate session * @return Allowed FeatureOfInterestTypes */ public List<String> getAllowedFeatureOfInterestTypes(String offeringIdentifier, Session session) { if (HibernateHelper.isEntitySupported(OfferingEntity.class)) { Criteria criteria = getDefaultTransactionalCriteria(session) .add(Restrictions.eq(OfferingEntity.IDENTIFIER, offeringIdentifier)); LOGGER.debug("QUERY getAllowedFeatureOfInterestTypes(offering): {}", HibernateHelper.getSqlString(criteria)); OfferingEntity offering = (OfferingEntity) criteria.uniqueResult(); if (offering != null) { List<String> list = Lists.newArrayList(); for (FormatEntity featureOfInterestType : offering.getFeatureTypes()) { list.add(featureOfInterestType.getFormat()); } return list; } } return Lists.newArrayList(); }
getCache().setAllowedFeatureOfInterestTypeForOffering(identifier, toStringSet(offering.getFeatureTypes()));