private BBoxTableMapping generateBBoxMapping() { // TODO String ftTable = "FEATURE_TYPES"; return new BBoxTableMapping( ftTable, geometryParams.getCrs() ); }
@Override public ResourceMetadata<FeatureStore> createFromLocation( Workspace workspace, ResourceLocation<FeatureStore> location ) { return new SqlFeatureStoreMetadata( workspace, location, this ); }
/** * Creates a new {@link InsertRowManager} instance. * * @param fs * feature store, must not be <code>null</code> * @param conn * connection, must not be <code>null</code> * @param idGenMode * feature id generation mode, must not be <code>null</code> */ public InsertRowManager( SQLFeatureStore fs, Connection conn, IDGenMode idGenMode ) { this.fs = fs; this.dialect = fs.getDialect(); this.conn = conn; this.idGenMode = idGenMode; this.tableDeps = fs.getSchema().getKeyDependencies(); }
private void initConverters() { for ( FeatureType ft : schema.getFeatureTypes() ) { FeatureTypeMapping ftMapping = schema.getFtMapping( ft.getName() ); if ( ftMapping != null ) { for ( Mapping particleMapping : ftMapping.getMappings() ) { initConverter( particleMapping ); } } } }
public Map<String, String> getNamespaceContext() { if ( nsContext == null ) { nsContext = new HashMap<String, String>( getSchema().getNamespaceBindings() ); nsContext.put( "xlink", XLNNS ); nsContext.put( "xsi", XSINS ); nsContext.put( "ogc", OGCNS ); } return nsContext; }
private FeatureInputStream queryByIdFilter( TypeName[] typeNames, IdFilter filter, SortProperty[] sortCrit ) throws FeatureStoreException { if ( blobMapping != null ) { return queryByIdFilterBlob( typeNames, filter, sortCrit ); } return queryByIdFilterRelational( typeNames, filter, sortCrit ); }
@Override public boolean isMapped( QName ftName ) { if ( schema.getFtMapping( ftName ) != null ) { return true; } if ( schema.getBBoxMapping() != null ) { return true; } return false; }
@Override public int performDelete( QName ftName, OperatorFilter filter, Lock lock ) throws FeatureStoreException { // TODO implement this more efficiently return performDelete( getIdFilter( ftName, filter ), lock ); }
MappedAppSchema getSchema() { return fs.getSchema(); }
private AbstractWhereBuilder getWhereBuilder( FeatureType ft, OperatorFilter filter, SortProperty[] sortCrit, Connection conn ) throws FilterEvaluationException, UnmappableException { PropertyNameMapper mapper = new SQLPropertyNameMapper( this, getMapping( ft.getName() ) ); return dialect.getWhereBuilder( mapper, filter, sortCrit, allowInMemoryFiltering ); }
@Override public int[] queryHits( Query[] queries ) throws FeatureStoreException, FilterEvaluationException { int[] hits = new int[queries.length]; for ( int i = 0; i < queries.length; i++ ) { hits[i] = queryHits( queries[i] ); } return hits; }
@Override protected Feature createElement( ResultSet rs ) throws SQLException { return builder.buildFeature( rs ); } }
/** * Returns the relational mapping for the given feature type name. * * @param ftName * name of the feature type, must not be <code>null</code> * @return relational mapping for the feature type, may be <code>null</code> (no relational mapping) */ public FeatureTypeMapping getMapping( QName ftName ) { return schema.getFtMapping( ftName ); }
public ColumnMetadataOld( String column, int sqlType, String sqlTypeName, boolean isNullable, GeometryType geomType, CoordinateDimension dim, ICRS crs, String srid ) { this.column = column; this.sqlType = sqlType; this.sqlTypeName = sqlTypeName; this.isNullable = isNullable; this.geomType = geomType; this.geometryParams = new GeometryStorageParams( crs, srid, dim ); } }
@Override public PropertyNameMapping getSpatialMapping( ValueReference propName, TableAliasManager aliasManager ) throws FilterEvaluationException, UnmappableException { return getMapping( propName, aliasManager ); } };
/** * Creates a new {@link DDLCreator} instance for the given {@link MappedAppSchema}. * * @param schema * mapped application schema, must not be <code>null</code> * @param dialect * SQL dialect, must not be <code>null</code> */ protected DDLCreator( MappedAppSchema schema, SQLDialect dialect ) { this.schema = schema; this.dialect = dialect; hasBlobTable = schema.getBlobMapping() != null; }
public String getSrid() { return geometryParams.getSrid(); }
public CoordinateDimension getDim() { return geometryParams.getDim(); }
public ICRS getCRS() { return geometryParams.getCrs(); }