mhgrove / Empire

JPA implementation for RDF
http://groups.google.com/group/empire-rdf/
Apache License 2.0
98 stars 34 forks source link

update on static NamedGraph dont work #98

Closed suricatec closed 4 years ago

suricatec commented 9 years ago

When you persist an object in a static named graph, updates is not put on this graph. Only the RDFType stay in it, but all other properties move to the default graph.

old_namedgraph_empire

The cause of this bug is probably in the class com.clarkparsia.empire.util. EmpireUtil in the methods hasNamedGraphSpecified(Object theObj) and getNamedGraph(Object) . In this methods there’s the same line :

NamedGraph aAnnotation = theObj.getClass().getAnnotation(NamedGraph.class);

The problem with it, is that annotations of persistent classes can’t be reached throuth the proxy. To get annotations I do it from the beans cache :

NamedGraph aAnnotation = BeanReflectUtil.getAnnotation(theObj.getClass(), NamedGraph.class);

And after it’s fixed.

new_namedgraph_empire