Fixing bug on properties

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@134351 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-11-17 17:47:00 +00:00
parent daf61bc522
commit ab786c6f28
3 changed files with 5 additions and 6 deletions

View File

@ -153,7 +153,6 @@ public class EntityManagementImpl implements EntityManagement {
SchemaManagementImpl schemaManagement = new SchemaManagementImpl(); SchemaManagementImpl schemaManagement = new SchemaManagementImpl();
try { try {
schemaManagement.getTypeSchema(type, Embedded.NAME); schemaManagement.getTypeSchema(type, Embedded.NAME);
} catch (SchemaNotFoundException e) { } catch (SchemaNotFoundException e) {
throw e; throw e;
} }
@ -180,7 +179,7 @@ public class EntityManagementImpl implements EntityManagement {
return null; return null;
} }
public static Object getObejctFromElement(JsonNode value) public static Object getObjectFromElement(JsonNode value)
throws ResourceRegistryException { throws ResourceRegistryException {
JsonNodeType jsonNodeType = value.getNodeType(); JsonNodeType jsonNodeType = value.getNodeType();
@ -193,7 +192,7 @@ public class EntityManagementImpl implements EntityManagement {
Iterator<JsonNode> arrayElement = value.elements(); Iterator<JsonNode> arrayElement = value.elements();
while (arrayElement.hasNext()) { while (arrayElement.hasNext()) {
JsonNode arrayNode = arrayElement.next(); JsonNode arrayNode = arrayElement.next();
Object objectNode = getObejctFromElement(arrayNode); Object objectNode = getObjectFromElement(arrayNode);
if (objectNode != null) { if (objectNode != null) {
array.add(objectNode); array.add(objectNode);
} }
@ -265,7 +264,7 @@ public class EntityManagementImpl implements EntityManagement {
JsonNode value = entry.getValue(); JsonNode value = entry.getValue();
Object object = null; Object object = null;
try { try {
object = getObejctFromElement(value); object = getObjectFromElement(value);
if (object != null) { if (object != null) {
map.put(key, object); map.put(key, object);
} }

View File

@ -75,7 +75,7 @@ public class SchemaManagementImpl implements SchemaManagement {
OClass oClass = getEntityOClass(orientGraphNoTx, type); OClass oClass = getEntityOClass(orientGraphNoTx, type);
if (baseType != null) { if (baseType != null) {
if (!oClass.isSubClassOf(baseType)) { if(baseType.compareTo(Embedded.NAME)!=0 && !oClass.isSubClassOf(baseType)) {
throw new SchemaException("The requested type is not a " throw new SchemaException("The requested type is not a "
+ baseType); + baseType);
} }