|
@@ -59,14 +59,14 @@ public class SearchLogBhv extends BsSearchLogBhv {
|
|
@Override
|
|
@Override
|
|
protected <RESULT extends SearchLog> RESULT createEntity(final Map<String, Object> source, final Class<? extends RESULT> entityType) {
|
|
protected <RESULT extends SearchLog> RESULT createEntity(final Map<String, Object> source, final Class<? extends RESULT> entityType) {
|
|
try {
|
|
try {
|
|
- final RESULT result = entityType.newInstance();
|
|
|
|
|
|
+ final RESULT result = super.createEntity(source, entityType);
|
|
final Object searchFieldObj = source.get("searchField");
|
|
final Object searchFieldObj = source.get("searchField");
|
|
if (searchFieldObj instanceof Map) {
|
|
if (searchFieldObj instanceof Map) {
|
|
((Map<String, String>) searchFieldObj).entrySet().stream()
|
|
((Map<String, String>) searchFieldObj).entrySet().stream()
|
|
.forEach(e -> result.getSearchFieldLogList().add(new Pair(e.getKey(), e.getValue())));
|
|
.forEach(e -> result.getSearchFieldLogList().add(new Pair(e.getKey(), e.getValue())));
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
- } catch (InstantiationException | IllegalAccessException e) {
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
final String msg = "Cannot create a new instance: " + entityType.getName();
|
|
final String msg = "Cannot create a new instance: " + entityType.getName();
|
|
throw new IllegalBehaviorStateException(msg, e);
|
|
throw new IllegalBehaviorStateException(msg, e);
|
|
}
|
|
}
|