Skip to content

Commit

Permalink
add try catch for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
firestar committed Sep 2, 2024
1 parent 8290c33 commit f26af9a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencyManagement {
}
}
group = 'com.nucleodb'
version = '3.5.3'
version = '3.5.4'

repositories {
mavenCentral()
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/nucleodb/spring/NDBRepositoryFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ public NDBRepositoryFactory(NucleoDB nucleoDB, ApplicationEventPublisher publish

@Override
public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> entityClass) {
return new NDBEntityInformation<>(entityClass, (Class<ID>) String.class);
try {
return (EntityInformation<T, ID>) new NDBEntityInformation<>(entityClass, String.class);
}catch (Exception e){
e.printStackTrace();
}
return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public boolean isNew(T entity) {
@Override
public ID getId(T entity) {
try {
Field idField = entityClass.getDeclaredField("id");
Field idField = entityClass.getDeclaredField("key");
if(idField == null) {
idField = entityClass.getDeclaredField("uuid");
}
Expand All @@ -34,7 +34,6 @@ public ID getId(T entity) {
}
}


@Override
public Class<ID> getIdType() {
return idClass;
Expand Down

0 comments on commit f26af9a

Please sign in to comment.