@Override public PropertyNameMapping getMapping( ValueReference propName, TableAliasManager aliasManager ) throws FilterEvaluationException, UnmappableException { GeometryStorageParams geometryParams = new GeometryStorageParams( blobMapping.getCRS(), undefinedSrid, CoordinateDimension.DIM_2 ); GeometryMapping bboxMapping = new GeometryMapping( null, false, new DBField( blobMapping.getBBoxColumn() ), GeometryType.GEOMETRY, geometryParams, null ); return new PropertyNameMapping( getGeometryConverter( bboxMapping ), null, blobMapping.getBBoxColumn(), aliasManager.getRootTableAlias() ); }
DBField dbField = new DBField( md.column ); QName ptName = makeFullyQualified( new QName( md.column.toLowerCase() ), ftName.getPrefix(), ftName.getNamespaceURI() );
DBField dbField = new DBField( md.column ); QName ptName = makeFullyQualified( new QName( md.column.toLowerCase() ), ftName.getPrefix(), ftName.getNamespaceURI() );
private PrimitiveMapping generatePropMapping( SimplePropertyType pt, MappingContext mc ) { LOG.debug( "Mapping simple property '" + pt.getName() + "'" ); ValueReference path = getPropName( pt.getName() ); MappingContext propMc = null; List<TableJoin> jc = null; MappingExpression mapping = null; if ( pt.getMaxOccurs() == 1 ) { propMc = mcManager.mapOneToOneElement( mc, pt.getName() ); mapping = new DBField( propMc.getColumn() ); } else { propMc = mcManager.mapOneToManyElements( mc, pt.getName() ); jc = generateJoinChain( mc, propMc ); mapping = new DBField( "value" ); } return new PrimitiveMapping( path, false, mapping, pt.getPrimitiveType(), jc, null ); }
DBField dbField = new DBField( attrMc.getTable(), attrMc.getColumn() ); PrimitiveType pt = new PrimitiveType( attrDecl.getTypeDefinition() ); particles.add( new PrimitiveMapping( path, !attrUse.getRequired(), dbField, pt, null, null ) ); MappingContext attrMc = mcManager.mapOneToOneAttribute( mc, attrName ); ValueReference path = new ValueReference( "@" + getName( attrName ), null ); DBField dbField = new DBField( attrMc.getTable(), attrMc.getColumn() ); particles.add( new PrimitiveMapping( path, true, dbField, new PrimitiveType( BOOLEAN ), null, null ) ); GeometryType gt = GeometryType.GEOMETRY; MappingContext elMC = mcManager.mapOneToOneElement( mc, new QName( "value" ) ); particles.add( new GeometryMapping( path, true, new DBField( elMC.getColumn() ), gt, geometryParams, null ) ); } else if ( opt instanceof FeaturePropertyType ) { QName valueFtName = ( (FeaturePropertyType) opt ).getFTName(); particles.add( new FeatureMapping( path, true, new DBField( hrefMC.getColumn() ), valueFtName, jc ) ); } else { LOG.warn( "Unhandled object property type '" + opt.getClass() + "'." );
private GeometryMapping generatePropMapping( GeometryPropertyType pt, MappingContext mc ) { LOG.debug( "Mapping geometry property '" + pt.getName() + "'" ); ValueReference path = getPropName( pt.getName() ); MappingContext propMc = null; List<TableJoin> jc = null; MappingExpression mapping = null; if ( pt.getMaxOccurs() == 1 ) { propMc = mcManager.mapOneToOneElement( mc, pt.getName() ); mapping = new DBField( propMc.getColumn() ); } else { propMc = mcManager.mapOneToManyElements( mc, pt.getName() ); jc = generateJoinChain( mc, propMc ); mapping = new DBField( "value" ); } return new GeometryMapping( path, pt.getMinOccurs() == 0, mapping, pt.getGeometryType(), geometryParams, jc ); }
return new FeatureMapping( path, pt.getMinOccurs() == 0, new DBField( hrefMC.getColumn() ), pt.getFTName(), jc );
MappingExpression mapping = new DBField( elMC.getColumn() ); PrimitiveType pt = new PrimitiveType( (XSSimpleTypeDefinition) typeDef ); mappings.add( new PrimitiveMapping( path, false, mapping, pt, jc, null ) );
private CompoundMapping generatePropMapping( CodePropertyType pt, MappingContext mc ) { LOG.debug( "Mapping code property '" + pt.getName() + "'" ); ValueReference path = getPropName( pt.getName() ); MappingContext propMc = null; MappingContext codeSpaceMc = null; List<TableJoin> jc = null; MappingExpression mapping = null; if ( pt.getMaxOccurs() == 1 ) { propMc = mcManager.mapOneToOneElement( mc, pt.getName() ); codeSpaceMc = mcManager.mapOneToOneAttribute( propMc, new QName( "codeSpace" ) ); mapping = new DBField( propMc.getColumn() ); } else { propMc = mcManager.mapOneToManyElements( mc, pt.getName() ); codeSpaceMc = mcManager.mapOneToOneAttribute( propMc, new QName( "codeSpace" ) ); jc = generateJoinChain( mc, propMc ); mapping = new DBField( "value" ); } MappingExpression csMapping = new DBField( codeSpaceMc.getColumn() ); List<Mapping> particles = new ArrayList<Mapping>(); particles.add( new PrimitiveMapping( new ValueReference( "text()", null ), false, mapping, new PrimitiveType( STRING ), null, null ) ); particles.add( new PrimitiveMapping( new ValueReference( "@codeSpace", null ), true, csMapping, new PrimitiveType( STRING ), null, null ) ); return new CompoundMapping( path, pt.getMinOccurs() == 0, particles, jc, pt.getElementDecl() ); }
column = "value"; DBField dbField = new DBField( mc.getTable(), column ); PrimitiveType pt = new PrimitiveType( BaseType.STRING ); if ( typeDef.getSimpleType() != null ) { DBField dbField = new DBField( attrMc.getTable(), attrMc.getColumn() ); PrimitiveType pt = new PrimitiveType( attrDecl.getTypeDefinition() ); particles.add( new PrimitiveMapping( path, !attrUse.getRequired(), dbField, pt, null, null ) ); MappingContext attrMc = mcManager.mapOneToOneAttribute( mc, attrName ); ValueReference path = new ValueReference( "@" + getName( attrName ), null ); DBField dbField = new DBField( attrMc.getTable(), attrMc.getColumn() ); particles.add( new PrimitiveMapping( path, true, dbField, new PrimitiveType( BOOLEAN ), null, null ) );
/** * Creates a new {@link SQLFeatureStoreTransaction} instance. * * @param store * corresponding feature store instance, must not be <code>null</code> * @param conn * JDBC connection associated with the transaction, must not be <code>null</code> and have * <code>autocommit</code> set to <code>false</code> * @param schema * application schema with mapping information, must not be <code>null</code> * @param inspectors * feature inspectors, must not be <code>null</code> */ SQLFeatureStoreTransaction( SQLFeatureStore store, Connection conn, MappedAppSchema schema, List<FeatureInspector> inspectors ) { this.fs = store; this.conn = conn; this.schema = schema; this.inspectors = inspectors; blobMapping = schema.getBlobMapping(); if ( blobMapping != null ) { DBField bboxColumn = new DBField( blobMapping.getBBoxColumn() ); GeometryStorageParams geometryParams = new GeometryStorageParams( blobMapping.getCRS(), null, DIM_2 ); GeometryMapping blobGeomMapping = new GeometryMapping( null, true, bboxColumn, GeometryType.GEOMETRY, geometryParams, null ); blobGeomConverter = fs.getGeometryConverter( blobGeomMapping ); } this.bboxTracker = new BBoxTracker(); }
if ( joinConfig != null ) { jc = buildJoinTable( table, joinConfig ); DBField dbField = new DBField( jc.get( 0 ).getToTable().toString(), jc.get( 0 ).getToColumns().get( 0 ).toString() ); valueTable = new TableName( dbField.getTable(), dbField.getSchema() );