merging changes for NIHVIVO-959 fillExistingObjectPropertyStatements error
This commit is contained in:
parent
32fa4851a6
commit
44976b4b72
2 changed files with 66 additions and 61 deletions
|
@ -638,13 +638,13 @@ public class IndividualJena extends IndividualImpl implements Individual {
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
webappDaoFactory.getObjectPropertyStatementDao().fillExistingObjectPropertyStatements(this);
|
webappDaoFactory.getObjectPropertyStatementDao().fillExistingObjectPropertyStatements(this);
|
||||||
Iterator stmtIt = this.getObjectPropertyStatements().iterator();
|
//Iterator stmtIt = this.getObjectPropertyStatements().iterator();
|
||||||
while (stmtIt.hasNext()) {
|
//while (stmtIt.hasNext()) {
|
||||||
ObjectPropertyStatement stmt = (ObjectPropertyStatement) stmtIt.next();
|
// ObjectPropertyStatement stmt = (ObjectPropertyStatement) stmtIt.next();
|
||||||
stmt.setObject(webappDaoFactory.getIndividualDao().getIndividualByURI(stmt.getObject().getURI()));
|
// stmt.setObject(webappDaoFactory.getIndividualDao().getIndividualByURI(stmt.getObject().getURI()));
|
||||||
}
|
//}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(this.getClass().getName()+" could not fill existing ObjectPropertyStatements for "+this.getURI());
|
log.error(this.getClass().getName()+" could not fill existing ObjectPropertyStatements for "+this.getURI(), e);
|
||||||
}
|
}
|
||||||
return this.objectPropertyStatements;
|
return this.objectPropertyStatements;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,8 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec
|
||||||
|
|
||||||
ObjectPropertyDaoJena opDaoJena = new ObjectPropertyDaoJena(getWebappDaoFactory());
|
ObjectPropertyDaoJena opDaoJena = new ObjectPropertyDaoJena(getWebappDaoFactory());
|
||||||
|
|
||||||
|
getOntModel().enterCriticalSection(Lock.READ);
|
||||||
|
try {
|
||||||
Resource ind = getOntModel().getResource(entity.getURI());
|
Resource ind = getOntModel().getResource(entity.getURI());
|
||||||
List<ObjectPropertyStatement> objPropertyStmtList = new ArrayList<ObjectPropertyStatement>();
|
List<ObjectPropertyStatement> objPropertyStmtList = new ArrayList<ObjectPropertyStatement>();
|
||||||
ClosableIterator<Statement> propIt = ind.listProperties();
|
ClosableIterator<Statement> propIt = ind.listProperties();
|
||||||
|
@ -116,6 +118,9 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec
|
||||||
propIt.close();
|
propIt.close();
|
||||||
}
|
}
|
||||||
entity.setObjectPropertyStatements(objPropertyStmtList);
|
entity.setObjectPropertyStatements(objPropertyStmtList);
|
||||||
|
} finally {
|
||||||
|
getOntModel().leaveCriticalSection();
|
||||||
|
}
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue