Issue #1869 Fix unique checking for things without dataURI and with subtables.
Former-commit-id:cdf8e7daaa
[formerly3b6156843e
] [formerly7be9ad1f8b
[formerly 3f600c5e7b0fb53aff7c8c594e5ca58c4f8250ef]] Former-commit-id:7be9ad1f8b
Former-commit-id:2a8a87e564
This commit is contained in:
parent
e976a4c94e
commit
c71afc4198
1 changed files with 14 additions and 2 deletions
|
@ -38,6 +38,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import org.apache.commons.beanutils.PropertyUtils;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.QueryException;
|
||||
import org.hibernate.Session;
|
||||
|
@ -372,10 +373,21 @@ public abstract class PluginDao extends CoreDao {
|
|||
for (Entry<String, Object> uriEntry : DataURIUtil.createDataURIMap(pdo)
|
||||
.entrySet()) {
|
||||
String key = uriEntry.getKey();
|
||||
Object value = uriEntry.getValue();
|
||||
if (key.equals("pluginName")) {
|
||||
;// this is not in the db, only used internally.
|
||||
} else if (value == null) {
|
||||
continue;
|
||||
}
|
||||
Object value = uriEntry.getValue();
|
||||
int dotIndex = key.indexOf(".");
|
||||
if (dotIndex > 0) {
|
||||
key = key.substring(0, dotIndex);
|
||||
try {
|
||||
value = PropertyUtils.getProperty(pdo, key);
|
||||
} catch (Exception e) {
|
||||
throw new PluginException(e);
|
||||
}
|
||||
}
|
||||
if (value == null) {
|
||||
criteria.add(Restrictions.isNull(key));
|
||||
} else {
|
||||
criteria.add(Restrictions.eq(key, value));
|
||||
|
|
Loading…
Add table
Reference in a new issue