| | |
| | | |
| | | private FeatureTypeBuilder typeBuilderPnt = null; |
| | | private FeatureTypeBuilder typeBuilderRect = null; |
| | | private FeatureTypeBuilder typeBuilderSmallRect = null; |
| | | |
| | | private FeatureType featureType = null; |
| | | private FeatureType featureType2 = null; |
| | |
| | | return typeBuilderPnt.getFeatureType(); |
| | | } |
| | | |
| | | public FeatureType createFeatureElement3(String featureName) throws SchemaException |
| | | { |
| | | if (typeBuilderSmallRect == null) |
| | | { |
| | | typeBuilderSmallRect = FeatureTypeBuilderUtil.createNormalIndexFeatureTypeBuilder(featureName); |
| | | if (isExistFeature(typeBuilderSmallRect.getFeatureType())) |
| | | { |
| | | try |
| | | { |
| | | Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); |
| | | if (dropTableMode) |
| | | { |
| | | try |
| | | { |
| | | dropGeometryColumn(conn, featureName, |
| | | typeBuilderSmallRect.getFeatureType().getDefaultGeometry().getLocalName()); |
| | | } catch (PSQLException e) |
| | | { |
| | | logger.debug(e.getMessage(), e); |
| | | } |
| | | try |
| | | { |
| | | dropTable(conn, featureName); |
| | | } catch (PSQLException e) |
| | | { |
| | | logger.debug(e.getMessage(), e); |
| | | } |
| | | ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilderSmallRect.getFeatureType()); |
| | | for (String stmtText : schemaTexts) |
| | | { |
| | | Statement stmt = conn.createStatement(); |
| | | stmt.execute(stmtText); |
| | | stmt.close(); |
| | | } |
| | | } else |
| | | { |
| | | deleteTable(conn, featureName); |
| | | } |
| | | conn.close(); |
| | | } catch (IOException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } catch (SQLException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } |
| | | } else |
| | | { |
| | | try |
| | | { |
| | | Connection conn = targetDataStore.getConnection(Transaction.AUTO_COMMIT); |
| | | ArrayList<String> schemaTexts = createNewSchemaTexts(typeBuilderSmallRect.getFeatureType()); |
| | | for (String stmtText : schemaTexts) |
| | | { |
| | | Statement stmt = conn.createStatement(); |
| | | stmt.execute(stmtText); |
| | | stmt.close(); |
| | | } |
| | | conn.close(); |
| | | } catch (IOException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } catch (SQLException e) |
| | | { |
| | | logger.warn(e.getMessage(), e); |
| | | } |
| | | } |
| | | } |
| | | return typeBuilderSmallRect.getFeatureType(); |
| | | } |
| | | |
| | | public Feature createFeature(FeatureType featureType, Element element) throws IllegalAttributeException |
| | | { |
| | | DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance(); |
| | |
| | | dgnname = dgnname.substring(0, i); |
| | | } |
| | | dgnname = dgnname + "_s"; |
| | | featureType3 = createFeatureElement(dgnname.toLowerCase()); |
| | | featureType3 = createFeatureElement3(dgnname.toLowerCase()); |
| | | } |
| | | return createFeature3(featureType3, element); |
| | | } |