From 648abc52c3d0584c9bd49e3ebb6b4870f91d7fa3 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 14 Dec 2020 12:36:53 +0100 Subject: [PATCH] Implementing type update --- .../resourceregistry/types/SchemaManagementImpl.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/types/SchemaManagementImpl.java b/src/main/java/org/gcube/informationsystem/resourceregistry/types/SchemaManagementImpl.java index 46960c3..7be780c 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/types/SchemaManagementImpl.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/types/SchemaManagementImpl.java @@ -377,7 +377,7 @@ public class SchemaManagementImpl implements SchemaManagement { // TODO protected void updateTypeSchema(Type type, AccessType baseElementAccessType) - throws SchemaAlreadyPresentException, SchemaException { + throws SchemaNotFoundException, SchemaException { ODatabaseDocument oDatabaseDocument = null; try { @@ -505,15 +505,12 @@ public class SchemaManagementImpl implements SchemaManagement { oSchema.dropClass(type.getName()); throw e; } - } catch(OSchemaException ex) { - if(ex.getMessage().contains("already exists")) { - throw new SchemaAlreadyPresentException(ex); - } - throw new SchemaException(ex); + } catch(SchemaNotFoundException e) { + throw e; } catch(SchemaException e) { throw e; } catch(Exception ex) { - throw new SchemaCreationException(ex); + throw new SchemaException(ex); } finally { oDatabaseDocument.close(); }