Changeset 6100
- Timestamp:
- 2003-12-03T09:38:12+13:00 (20 years ago)
- Location:
- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/util
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/util/GS3SQLConnection.java
r6016 r6100 177 177 // create document table 178 178 GS3SQLCreateTable docTable = new GS3SQLCreateTable("document"); 179 docTable.addProperty("DocID", 64); 180 docTable.setPrimaryKey("DocID"); 181 docTable.addProperty("DocType", 64); 179 docTable.addProperty("DocID", 64); // The document identifer, unique in collection 180 docTable.setPrimaryKey("DocID"); // ...which is also the primary key 181 docTable.addProperty("DocType", 64); // The document type - used to regenerate the 182 // correct Document object type. 182 183 statement = this.connection.createStatement(); 183 System.out.println(docTable.toString());184 184 statement.execute(docTable.toString()); 185 185 … … 187 187 GS3SQLCreateTable structureMap = new GS3SQLCreateTable("structure"); 188 188 structureMap.addAutoPrimaryKey("StructureRef"); 189 structureMap.addProperty("DocID", 64); // a 'foreign key' in effect - but not treated190 // as such for efficiency reasons191 structureMap.addProperty("StructureID", 64); // this identifier192 structureMap.addProperty("StructureType", 64); 193 structureMap.addProperty("Label", 128); // the label of the structure189 structureMap.addProperty("DocID", 64); // a 'foreign key' in effect - but not treated 190 // as such for efficiency reasons 191 structureMap.addProperty("StructureID", 64); // this identifier 192 structureMap.addProperty("StructureType", 64); // the type of the structure 193 structureMap.addProperty("Label", 128); // the label of the structure 194 194 statement.execute(structureMap.toString()); 195 195 … … 199 199 sectionMap.addProperty("StructureRef", GS3SQLField.INTEGER_TYPE); 200 200 sectionMap.addProperty("DocID", 64); // a 'foreign key' in effect - but not treated 201 // as such for efficiency reasons202 sectionMap.addProperty("ParentType", 64); 203 sectionMap.addProperty("ParentRef", 64); 204 sectionMap.addProperty("SectionID", 64); 205 sectionMap.addProperty("DivisionType", 64); 201 // as such for efficiency reasons 202 sectionMap.addProperty("ParentType", 64); // the type of the parent - document or section 203 sectionMap.addProperty("ParentRef", 64); // the parent sql reference identifier 204 sectionMap.addProperty("SectionID", 64); // this identifier 205 sectionMap.addProperty("DivisionType", 64); // the type of the section 206 206 sectionMap.addProperty("LabelOrder", 64); // the order of the section 207 207 sectionMap.addProperty("ShortLabel", 128); // the short label of the section 208 208 sectionMap.addProperty("UserLabel", 255); // the long label of the section 209 System.out.println(sectionMap.toString());210 209 statement.execute(sectionMap.toString()); 211 210 … … 232 231 metadataSection.addProperty("MetaID", 64); // in and of itself... 233 232 metadataSection.addProperty("GroupID", 64); // the 'name' property 234 System.out.println(metadataSection.toString());235 233 statement.execute(metadataSection.toString()); 236 234 … … 284 282 285 283 // create admin table...etc. 284 285 // 286 // END OF METS TABLES 287 // 288 289 // 290 // BEGINNING OF GSDL TABLES 291 // 292 GS3SQLCreateTable classifiers = new GS3SQLCreateTable("classifiers"); 293 classifiers.addAutoPrimaryKey("ClassifyRef"); 294 classifiers.addProperty("ClassifyID"); 295 classifiers.addProperty("ParentID"); 296 classifiers.addProperty("Name"); 297 classifiers.addProperty("Description"); 298 statement.execute(classifiers.toString()); 299 300 GS3SQLCreateTable classDocs = new GS3SQLCreateTable("classdocuments"); 301 classDocs.addProperty("ClassifyRef", GS3SQLField.INTEGER_TYPE); 302 classDocs.addProperty("DocID"); 303 statement.execute(classDocs.toString()); 304 305 GS3SQLCreateTable classData = new GS3SQLCreateTable("classdata"); 306 classData.addProperty("ClassifyRef", GS3SQLField.INTEGER_TYPE); 307 classData.addProperty("Label"); 308 classData.addProperty("Value"); 309 statement.execute(classData.toString()); 310 311 // 312 // END OF GSDL TABLES 313 // 314 286 315 } 287 316 catch (SQLException ex)
Note:
See TracChangeset
for help on using the changeset viewer.