@@ -394,8 +394,7 @@ private DocIndexType loadVirtualTableMetadata() throws ModuleException, FileNotF
394394 SchemaFactory schemaFactory = SchemaFactory .newInstance (XMLConstants .W3C_XML_SCHEMA_NS_URI );
395395 Schema xsdSchema = null ;
396396 InputStream xsdInputStream = new FileInputStream (pathStrategy .getMainFolder ().getPath ().toString ()
397- + SIARDDKConstants .RESOURCE_FILE_SEPARATOR
398- + pathStrategy .getXsdFilePath (SIARDDKConstants .DOC_INDEX ));
397+ + SIARDDKConstants .RESOURCE_FILE_SEPARATOR + pathStrategy .getXsdFilePath (SIARDDKConstants .DOC_INDEX ));
399398
400399 try {
401400 xsdSchema = schemaFactory .newSchema (new StreamSource (xsdInputStream ));
@@ -411,8 +410,16 @@ private DocIndexType loadVirtualTableMetadata() throws ModuleException, FileNotF
411410 unmarshaller .setSchema (xsdSchema );
412411 inputStreamXml = new FileInputStream (pathStrategy .getMainFolder ().getPath ().toString ()
413412 + SIARDDKConstants .RESOURCE_FILE_SEPARATOR + pathStrategy .getXmlFilePath (SIARDDKConstants .DOC_INDEX ));
414- JAXBElement <DocIndexType > jaxbElement = (JAXBElement <DocIndexType >) unmarshaller .unmarshal (inputStreamXml );
415- return jaxbElement .getValue ();
413+ Object result = unmarshaller .unmarshal (inputStreamXml );
414+ DocIndexType docIndex ;
415+ if (result instanceof JAXBElement ) {
416+ docIndex = ((JAXBElement <DocIndexType >) result ).getValue ();
417+ } else if (result instanceof DocIndexType ) {
418+ docIndex = (DocIndexType ) result ;
419+ } else {
420+ throw new IllegalArgumentException ("Unexpected object type: " + result .getClass ().getName ());
421+ }
422+ return docIndex ;
416423 } catch (JAXBException e ) {
417424 throw new ModuleException ().withMessage ("Error while Unmarshalling JAXB" ).withCause (e );
418425 } finally {
@@ -479,14 +486,14 @@ private List<ColumnStructure> createContextDocumentsTableColumns() {
479486 Type typeBlob = sqlStandardDatatypeImporter .getCheckedType ("<information unavailable>" , "<information unavailable>" ,
480487 "<information unavailable>" , "<information unavailable>" , Constants .BINARY_LARGE_OBJECT ,
481488 Constants .BINARY_LARGE_OBJECT );
482- VirtualColumnStructure columnID = new VirtualColumnStructure (SIARDDKConstants .DOCUMENT_ID , SIARDDKConstants . DOCUMENT_ID , typeInt ,
483- true , SIARDDKConstants .DOCUMENT_IDENTIFIER , "1" , true );
484- VirtualColumnStructure columnTitle = new VirtualColumnStructure (SIARDDKConstants .DOCUMENT_TITLE , SIARDDKConstants . DOCUMENT_TITLE , typeChar ,
485- true , SIARDDKConstants .DOCUMENT_TITLE_DESCRIPTION , "" , true );
486- VirtualColumnStructure columnDate = new VirtualColumnStructure (SIARDDKConstants .DOCUMENT_DATE , SIARDDKConstants . DOCUMENT_DATE , typeChar ,
487- true , SIARDDKConstants .DOCUMENT_DATE_DESCRIPTION , "" , true );
488- VirtualColumnStructure columnLOB = new VirtualColumnStructure (Constants .BLOB , Constants .BLOB_COLUMN_NAME , typeBlob , true ,
489- "" , "1" , true );
489+ VirtualColumnStructure columnID = new VirtualColumnStructure (SIARDDKConstants .DOCUMENT_ID ,
490+ SIARDDKConstants . DOCUMENT_ID , typeInt , true , SIARDDKConstants .DOCUMENT_IDENTIFIER , "1" , true );
491+ VirtualColumnStructure columnTitle = new VirtualColumnStructure (SIARDDKConstants .DOCUMENT_TITLE ,
492+ SIARDDKConstants . DOCUMENT_TITLE , typeChar , true , SIARDDKConstants .DOCUMENT_TITLE_DESCRIPTION , "" , true );
493+ VirtualColumnStructure columnDate = new VirtualColumnStructure (SIARDDKConstants .DOCUMENT_DATE ,
494+ SIARDDKConstants . DOCUMENT_DATE , typeChar , true , SIARDDKConstants .DOCUMENT_DATE_DESCRIPTION , "" , true );
495+ VirtualColumnStructure columnLOB = new VirtualColumnStructure (Constants .BLOB , Constants .BLOB_COLUMN_NAME , typeBlob ,
496+ true , "" , "1" , true );
490497 columnStructureList .add (columnID );
491498 columnStructureList .add (columnTitle );
492499 columnStructureList .add (columnDate );
@@ -503,8 +510,8 @@ private List<ColumnStructure> createVirtualTableColumns() {
503510 Type type = sqlStandardDatatypeImporter .getCheckedType ("<information unavailable>" , "<information unavailable>" ,
504511 "<information unavailable>" , "<information unavailable>" , Constants .BINARY_LARGE_OBJECT ,
505512 Constants .BINARY_LARGE_OBJECT );
506- VirtualColumnStructure columnLOB = new VirtualColumnStructure (Constants .BLOB , Constants .BLOB_COLUMN_NAME , type , true ,
507- "" , "1" , true );
513+ VirtualColumnStructure columnLOB = new VirtualColumnStructure (Constants .BLOB , Constants .BLOB_COLUMN_NAME , type ,
514+ true , "" , "1" , true );
508515 columnStructureList .add (columnID );
509516 columnStructureList .add (columnLOB );
510517 return columnStructureList ;
0 commit comments