diff --git a/buildSrc/src/main/groovy/nucleodb.library.gradle b/buildSrc/src/main/groovy/nucleodb.library.gradle index cfabd24..37329f8 100644 --- a/buildSrc/src/main/groovy/nucleodb.library.gradle +++ b/buildSrc/src/main/groovy/nucleodb.library.gradle @@ -3,7 +3,7 @@ plugins { } group = 'com.nucleodb' -version = '1.9.24' +version = '1.9.25' repositories { mavenCentral() diff --git a/library/src/main/java/com/nucleocore/library/database/tables/Connection.java b/library/src/main/java/com/nucleocore/library/database/tables/Connection.java index 76e7edb..d7124d0 100644 --- a/library/src/main/java/com/nucleocore/library/database/tables/Connection.java +++ b/library/src/main/java/com/nucleocore/library/database/tables/Connection.java @@ -60,12 +60,17 @@ public Connection(DataEntry from, String label, DataEntry to) { this.modified = Instant.now(); } - public T copy(Class clazz) throws JsonProcessingException { + public T copy(Class clazz) { ObjectMapper om = new ObjectMapper() .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS) .findAndRegisterModules() .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - return om.readValue(om.writeValueAsString(this), clazz); + try { + return om.readValue(om.writeValueAsString(this), clazz); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return null; } public Connection(DataEntry from, String label, DataEntry to, Map metadata) { diff --git a/library/src/main/java/com/nucleocore/library/database/utils/DataEntry.java b/library/src/main/java/com/nucleocore/library/database/utils/DataEntry.java index d4d8b8c..844a600 100644 --- a/library/src/main/java/com/nucleocore/library/database/utils/DataEntry.java +++ b/library/src/main/java/com/nucleocore/library/database/utils/DataEntry.java @@ -41,12 +41,17 @@ public DataEntry(Create create) throws ClassNotFoundException, JsonProcessingExc } - public T copy(Class clazz) throws JsonProcessingException { + public T copy(Class clazz) { ObjectMapper om = new ObjectMapper() .enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS) .findAndRegisterModules() .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - return om.readValue(om.writeValueAsString(this), clazz); + try { + return om.readValue(om.writeValueAsString(this), clazz); + } catch (JsonProcessingException e) { + e.printStackTrace(); + } + return null; } public DataEntry() {