Fixing embeddedlist creation
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@146941 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7abfbacaa3
commit
77f241016b
|
@ -757,9 +757,18 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
|
|||
try {
|
||||
|
||||
Object object = properties.get(key);
|
||||
if(!oClass.existsProperty(key) && object instanceof ODocument){
|
||||
if(!oClass.existsProperty(key)){
|
||||
|
||||
if(object instanceof ODocument){
|
||||
ODocument oDocument = (ODocument) object;
|
||||
((OrientElement) element).setProperty(key, oDocument, OType.EMBEDDED);
|
||||
}
|
||||
|
||||
if(object instanceof ArrayList){
|
||||
((OrientElement) element).setProperty(key, object, OType.EMBEDDEDLIST);
|
||||
}
|
||||
|
||||
|
||||
} else{
|
||||
element.setProperty(key, object);
|
||||
}
|
||||
|
@ -850,6 +859,18 @@ public abstract class ERManagement<ERType extends ER, El extends Element> {
|
|||
return jsonArray;
|
||||
}
|
||||
|
||||
if(object instanceof ArrayList){
|
||||
@SuppressWarnings("rawtypes")
|
||||
ArrayList arrayList = (ArrayList) object;
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for(Object o : arrayList){
|
||||
Object obj = getPropertyForJson("PLACEHOLDER", o);
|
||||
jsonArray.put(obj);
|
||||
}
|
||||
|
||||
return jsonArray;
|
||||
}
|
||||
|
||||
return object.toString();
|
||||
|
||||
}catch(Exception e){
|
||||
|
|
Loading…
Reference in New Issue