@@ -42,84 +42,84 @@ public AttributeImporter(ImportHelper helper) throws SQLException {
42
42
@ Override
43
43
protected String getInsertStatement () {
44
44
return "insert into " + tableHelper .getPrefixedTableName (table ) +
45
- "(id, feature_id, parent_id, root_id, datatype_id, namespace_id, name, " +
45
+ "(id, feature_id, parent_id, datatype_id, namespace_id, name, " +
46
46
"val_int, val_double, val_string, val_timestamp, val_uri, val_codespace, val_uom, val_array, " +
47
47
"val_content, val_content_mime_type) " +
48
- "values (" + String .join ("," , Collections .nCopies (17 , "?" )) + ")" ;
48
+ "values (" + String .join ("," , Collections .nCopies (16 , "?" )) + ")" ;
49
49
}
50
50
51
51
public PropertyDescriptor doImport (Attribute attribute , long featureId ) throws ImportException , SQLException {
52
52
long propertyId = nextSequenceValue (Sequence .PROPERTY );
53
- return doImport (attribute , propertyId , propertyId , propertyId , featureId );
53
+ return doImport (attribute , propertyId , propertyId , featureId );
54
54
}
55
55
56
- PropertyDescriptor doImport (Attribute attribute , long parentId , long rootId , long featureId ) throws ImportException , SQLException {
57
- return doImport (attribute , nextSequenceValue (Sequence .PROPERTY ), parentId , rootId , featureId );
56
+ PropertyDescriptor doImport (Attribute attribute , long parentId , long featureId ) throws ImportException , SQLException {
57
+ return doImport (attribute , nextSequenceValue (Sequence .PROPERTY ), parentId , featureId );
58
58
}
59
59
60
- private PropertyDescriptor doImport (Attribute attribute , long propertyId , long parentId , long rootId , long featureId ) throws ImportException , SQLException {
60
+ private PropertyDescriptor doImport (Attribute attribute , long propertyId , long parentId , long featureId ) throws ImportException , SQLException {
61
61
Long intValue = attribute .getIntValue ().orElse (null );
62
62
if (intValue != null ) {
63
- stmt .setLong (8 , intValue );
63
+ stmt .setLong (7 , intValue );
64
64
} else {
65
- stmt .setNull (8 , Types .BIGINT );
65
+ stmt .setNull (7 , Types .BIGINT );
66
66
}
67
67
68
68
Double doubleValue = attribute .getDoubleValue ().orElse (null );
69
69
if (doubleValue != null ) {
70
- stmt .setDouble (9 , doubleValue );
70
+ stmt .setDouble (8 , doubleValue );
71
71
} else {
72
- stmt .setNull (9 , Types .DOUBLE );
72
+ stmt .setNull (8 , Types .DOUBLE );
73
73
}
74
74
75
- stmt .setString (10 , attribute .getStringValue ().orElse (null ));
75
+ stmt .setString (9 , attribute .getStringValue ().orElse (null ));
76
76
77
77
OffsetDateTime timestamp = attribute .getTimeStamp ().orElse (null );
78
78
if (timestamp != null ) {
79
- stmt .setObject (11 , timestamp );
79
+ stmt .setObject (10 , timestamp );
80
80
} else {
81
- stmt .setNull (11 , Types .TIMESTAMP );
81
+ stmt .setNull (10 , Types .TIMESTAMP );
82
82
}
83
83
84
- stmt .setString (12 , attribute .getURI ().orElse (null ));
85
- stmt .setString (13 , attribute .getCodeSpace ().orElse (null ));
86
- stmt .setString (14 , attribute .getUom ().orElse (null ));
84
+ stmt .setString (11 , attribute .getURI ().orElse (null ));
85
+ stmt .setString (12 , attribute .getCodeSpace ().orElse (null ));
86
+ stmt .setString (13 , attribute .getUom ().orElse (null ));
87
87
88
88
String arrayValue = attribute .getArrayValue ()
89
89
.map (array -> JSONArray .copyOf (array .getValues ().stream ()
90
90
.map (Value ::rawValue )
91
91
.collect (Collectors .toList ())).toString ())
92
92
.orElse (null );
93
93
if (arrayValue != null ) {
94
- stmt .setObject (15 , arrayValue , Types .OTHER );
94
+ stmt .setObject (14 , arrayValue , Types .OTHER );
95
95
} else {
96
- stmt .setNull (15 , Types .OTHER );
96
+ stmt .setNull (14 , Types .OTHER );
97
97
}
98
98
99
- stmt .setString (16 , attribute .getGenericContent ().orElse (null ));
100
- stmt .setString (17 , attribute .getGenericContentMimeType ().orElse (null ));
99
+ stmt .setString (15 , attribute .getGenericContent ().orElse (null ));
100
+ stmt .setString (16 , attribute .getGenericContentMimeType ().orElse (null ));
101
101
102
- PropertyDescriptor descriptor = super .doImport (attribute , propertyId , parentId , rootId , featureId );
102
+ PropertyDescriptor descriptor = super .doImport (attribute , propertyId , parentId , featureId );
103
103
104
104
if (attribute .hasProperties ()) {
105
105
for (Property <?> property : attribute .getProperties ().getAll ()) {
106
106
if (property instanceof Attribute ) {
107
- doImport ((Attribute ) property , parentId , rootId , featureId );
107
+ doImport ((Attribute ) property , parentId , featureId );
108
108
} else if (property instanceof FeatureProperty ) {
109
109
tableHelper .getOrCreateImporter (FeaturePropertyImporter .class )
110
- .doImport ((FeatureProperty ) property , parentId , rootId , featureId );
110
+ .doImport ((FeatureProperty ) property , parentId , featureId );
111
111
} else if (property instanceof GeometryProperty ) {
112
112
tableHelper .getOrCreateImporter (GeometryPropertyImporter .class )
113
- .doImport ((GeometryProperty ) property , parentId , rootId , featureId );
113
+ .doImport ((GeometryProperty ) property , parentId , featureId );
114
114
} else if (property instanceof ImplicitGeometryProperty ) {
115
115
tableHelper .getOrCreateImporter (ImplicitGeometryPropertyImporter .class )
116
- .doImport ((ImplicitGeometryProperty ) property , parentId , rootId , featureId );
116
+ .doImport ((ImplicitGeometryProperty ) property , parentId , featureId );
117
117
} else if (property instanceof AppearanceProperty ) {
118
118
tableHelper .getOrCreateImporter (AppearancePropertyImporter .class )
119
- .doImport ((AppearanceProperty ) property , parentId , rootId , featureId );
119
+ .doImport ((AppearanceProperty ) property , parentId , featureId );
120
120
} else if (property instanceof AddressProperty ) {
121
121
tableHelper .getOrCreateImporter (AddressPropertyImporter .class )
122
- .doImport ((AddressProperty ) property , parentId , rootId , featureId );
122
+ .doImport ((AddressProperty ) property , parentId , featureId );
123
123
}
124
124
}
125
125
}
0 commit comments