use of org.n52.series.db.beans.OfferingEntity in project SOS by 52North.
the class OfferingDAO method getOfferingForIdentifier.
/**
* Get Offering object for identifier
*
* @param identifier
* Offering identifier
* @param session
* Hibernate session
* @return Offering object
*/
public OfferingEntity getOfferingForIdentifier(final String identifier, final Session session) {
Criteria criteria = getDefaultCriteria(session).add(Restrictions.eq(OfferingEntity.IDENTIFIER, identifier));
LOGGER.debug("QUERY getOfferingForIdentifier(identifier): {}", HibernateHelper.getSqlString(criteria));
return (OfferingEntity) criteria.uniqueResult();
}
use of org.n52.series.db.beans.OfferingEntity in project SOS by 52North.
the class OfferingDAO method getTOfferingForIdentifier.
/**
* Get transactional offering object for identifier
*
* @param identifier
* Offering identifier
* @param session
* Hibernate session
* @return Transactional offering object
*/
public OfferingEntity getTOfferingForIdentifier(final String identifier, final Session session) {
Criteria criteria = getDefaultTransactionalCriteria(session).add(Restrictions.eq(OfferingEntity.IDENTIFIER, identifier));
LOGGER.debug("QUERY getTOfferingForIdentifier(): {}", HibernateHelper.getSqlString(criteria));
return (OfferingEntity) criteria.uniqueResult();
}
use of org.n52.series.db.beans.OfferingEntity in project SOS by 52North.
the class OfferingDAO method updateParentOfferings.
public void updateParentOfferings(Set<String> parentOfferings, OfferingEntity hOffering, Session session) {
for (String identifier : parentOfferings) {
OfferingEntity offering = getOfferingForIdentifier(identifier, session);
if (!offering.getChildren().contains(hOffering)) {
offering.addChild(hOffering);
session.saveOrUpdate(offering);
session.flush();
session.refresh(offering);
}
}
}
use of org.n52.series.db.beans.OfferingEntity in project SOS by 52North.
the class DeleteDataHelper method getDatasetForOffering.
default List<DatasetEntity> getDatasetForOffering(OfferingEntity offering, Session session) {
AbstractSeriesDAO seriesDAO = getDaoFactory().getSeriesDAO();
Criteria c = seriesDAO.getDefaultAllSeriesCriteria(session);
seriesDAO.addOfferingToCriteria(c, offering);
return c.list();
}
use of org.n52.series.db.beans.OfferingEntity in project SOS by 52North.
the class InsertResultHandler method insertObservationConstellationForProfiles.
private DatasetEntity insertObservationConstellationForProfiles(AbstractSeriesDAO obsConstDao, FormatDAO obsTypeDao, OmObservation o, Session session) throws OwsExceptionReport {
ProcedureEntity procedure = getDaoFactory().getProcedureDAO().getProcedureForIdentifier(o.getObservationConstellation().getProcedureIdentifier(), session);
PhenomenonEntity observableProperty = getDaoFactory().getObservablePropertyDAO().getOrInsertObservableProperty(o.getObservationConstellation().getObservableProperty(), session);
OfferingEntity offering = getDaoFactory().getOfferingDAO().getOfferingForIdentifier(o.getObservationConstellation().getOfferings().iterator().next(), session);
CategoryEntity category = getDaoFactory().getCategoryDAO().getOrInsertCategory(observableProperty, session);
DatasetEntity oc = obsConstDao.checkOrInsertSeries(procedure, observableProperty, offering, category, false, session);
if (o.getObservationConstellation().isSetObservationType()) {
oc.setOmObservationType(obsTypeDao.getFormatEntityObject(o.getObservationConstellation().getObservationType(), session));
}
return oc;
}
Aggregations