Revision 5c45a99a
Added by Andreas Müller almost 2 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/hibernate/PostMergeEntityListener.java | ||
---|---|---|
84 | 84 |
if (TaxonNode.class.isAssignableFrom(entityClazz)){ |
85 | 85 |
//do nothing (remove if #8127/#3722 is fully solved |
86 | 86 |
} else if (PolytomousKeyNode.class.isAssignableFrom(entityClazz)){ |
87 |
PolytomousKeyNode node = (PolytomousKeyNode) entity; |
|
88 |
if (node.getChildren() != null && Hibernate.isInitialized(node.getChildren()) ){ |
|
89 |
node.removeNullValueFromChildren(); |
|
90 |
for (PolytomousKeyNode childNode: node.getChildren()){ |
|
91 |
removeNullFromCollections(childNode); |
|
92 |
} |
|
93 |
} |
|
87 |
// PolytomousKeyNode node = (PolytomousKeyNode) entity; |
|
88 |
// if (node.getChildren() != null && Hibernate.isInitialized(node.getChildren()) ){ |
|
89 |
// node.removeNullValueFromChildren(); |
|
90 |
// for (PolytomousKeyNode childNode: node.getChildren()){ |
|
91 |
// removeNullFromCollections(childNode); |
|
92 |
// } |
|
93 |
// } |
|
94 |
//do nothing (remove if #8127/#3722 is fully solved |
|
94 | 95 |
}else if (PolytomousKey.class.isAssignableFrom(entityClazz)){ |
95 |
PolytomousKey key = (PolytomousKey) entity; |
|
96 |
PolytomousKeyNode node = key.getRoot(); |
|
97 |
if (node != null && node.getChildren() != null && Hibernate.isInitialized(node.getChildren()) ){ |
|
98 |
node.removeNullValueFromChildren(); |
|
99 |
for (PolytomousKeyNode childNode: node.getChildren()){ |
|
100 |
removeNullFromCollections(childNode); |
|
101 |
} |
|
102 |
} |
|
96 |
// PolytomousKey key = (PolytomousKey) entity; |
|
97 |
// PolytomousKeyNode node = key.getRoot(); |
|
98 |
// if (node != null && node.getChildren() != null && Hibernate.isInitialized(node.getChildren()) ){ |
|
99 |
//// node.removeNullValueFromChildren(); |
|
100 |
// for (PolytomousKeyNode childNode: node.getChildren()){ |
|
101 |
// removeNullFromCollections(childNode); |
|
102 |
// } |
|
103 |
// } |
|
104 |
//do nothing (remove if #8127/#3722 is fully solved |
|
103 | 105 |
}else if(TermTree.class.isAssignableFrom(entityClazz)){ |
104 | 106 |
//do nothing (remove if #8127/#3722 is fully solved |
105 | 107 |
} else if (TermNode.class.isAssignableFrom(entityClazz)){ |
Also available in: Unified diff
ref #10067, ref #3722, ref #8127 remove all manual sortindex and null value handling from polytomous key (node)