public static FeatureEntity createFeature(String domainId, String name, String description, GeometryEntity geometry, ProxyServiceEntity service) { FeatureEntity feature = new FeatureEntity(); feature.setName(name); feature.setDescription(description); feature.setDomainId(domainId); feature.setGeometryEntity(geometry); feature.setService(service); return feature; }
* Insert and/or get featureOfInterest object for identifier * * @param identifier * FeatureOfInterest identifier * @param url * FeatureOfInterest URL, if defined as link * @param session * Hibernate session * @return FeatureOfInterest object */ public AbstractFeatureEntity getOrInsert(String identifier, String url, Session session) { AbstractFeatureEntity feature = get(identifier, session); if (feature == null) { feature = new FeatureEntity(); feature.setIdentifier(identifier); if (url != null && !url.isEmpty()) { feature.setUrl(url); } FormatEntity type = new FormatDAO().getOrInsertFormatEntity(OGCConstants.UNKNOWN, session); feature.setFeatureType(type); session.save(feature); } else if (feature.getUrl() != null && !feature.getUrl().isEmpty() && url != null && !url.isEmpty()) { feature.setUrl(url); session.saveOrUpdate(feature); } // don't flush here because we may be batching return feature; } /**
* Insert and/or get featureOfInterest object for identifier * * @param identifier * FeatureOfInterest identifier * @param url * FeatureOfInterest URL, if defined as link * @param session * Hibernate session * @return FeatureOfInterest object */ public AbstractFeatureEntity getOrInsert(String identifier, String url, Session session) { AbstractFeatureEntity feature = get(identifier, session); if (feature == null) { feature = new FeatureEntity(); feature.setIdentifier(identifier); if (url != null && !url.isEmpty()) { feature.setUrl(url); } FormatEntity type = new FormatDAO().getOrInsertFormatEntity(OGCConstants.UNKNOWN, session); feature.setFeatureType(type); session.save(feature); } else if (feature.getUrl() != null && !feature.getUrl().isEmpty() && url != null && !url.isEmpty()) { feature.setUrl(url); session.saveOrUpdate(feature); } // don't flush here because we may be batching return feature; } /**