private GMLObject getObjectByIdRelational( String id ) throws FeatureStoreException { GMLObject result = null; IdAnalysis idAnalysis = getSchema().analyzeId( id ); if ( !idAnalysis.isFid() ) { String msg = "Fetching of geometries by id (relational mode) is not implemented yet."; throw new UnsupportedOperationException( msg ); } FeatureInputStream rs = queryByIdFilterRelational( null, new IdFilter( id ), null ); try { Iterator<Feature> iter = rs.iterator(); if ( iter.hasNext() ) { result = iter.next(); } } finally { rs.close(); } return result; }
private int performDeleteRelational( IdFilter filter, Lock lock ) throws FeatureStoreException { checkIfFeaturesAreNotLocked( filter, lock ); int deleted = 0; for ( ResourceId id : filter.getSelectedIds() ) { LOG.debug( "Analyzing id: " + id.getRid() ); IdAnalysis analysis = null; try { analysis = schema.analyzeId( id.getRid() ); LOG.debug( "Analysis: " + analysis ); if ( !schema.getKeyDependencies().getDeleteCascadingByDB() ) { LOG.debug( "Deleting joined rows manually." ); deleteJoinedRows( analysis ); } else { LOG.debug( "Depending on database to delete joined rows automatically." ); } deleted += deleteFeatureRow( analysis ); } catch ( IllegalArgumentException e ) { throw new FeatureStoreException( "Unable to determine feature type for id '" + id + "'." ); } } return deleted; }
try { for ( String fid : filter.getMatchingIds() ) { IdAnalysis analysis = getSchema().analyzeId( fid ); FeatureType ft = analysis.getFeatureType(); List<IdAnalysis> idKernels = ftNameToIdAnalysis.get( ft.getName() );
private void addRelationallyMappedMultiProperty( ParsedPropertyReplacement replacement, Mapping mapping, FeatureTypeMapping ftMapping, List<ResourceId> list ) throws FilterEvaluationException, FeatureStoreException, SQLException { UpdateAction action = replacement.getUpdateAction(); if ( action == null ) { action = UpdateAction.INSERT_AFTER; } switch ( action ) { case INSERT_BEFORE: case REMOVE: case REPLACE: LOG.warn( "Updating of multi properties is currently only supported for 'insertAfter' update action. Omitting." ); break; case INSERT_AFTER: break; default: break; } InsertRowManager mgr = new InsertRowManager( fs, conn, null ); List<Property> props = Collections.singletonList( replacement.getNewValue() ); for ( ResourceId id : list ) { IdAnalysis analysis = schema.analyzeId( id.getRid() ); FeatureType featureType = schema.getFeatureType( ftMapping.getFeatureType() ); Feature f = featureType.newFeature( id.getRid(), props, null ); mgr.updateFeature( f, ftMapping, analysis.getIdKernels(), mapping, replacement ); } }
IdAnalysis analysis = schema.analyzeId( id ); int j = i; for ( String fidKernel : analysis.getIdKernels() ) {
IdAnalysis analysis = mgr.getSchema().analyzeId( getOriginalId() ); idKernels = analysis.getIdKernels(); if ( !analysis.getFeatureType().getName().equals( ftMapping.getFeatureType() ) ) {