@@ -188,23 +188,40 @@ private void createOrupdateConfigObject(Date date, String componentName, ConfigK
188188
189189 _configDao .persist (vo );
190190 } else {
191+ boolean configUpdated = false ;
191192 if (vo .isDynamic () != key .isDynamic () || !ObjectUtils .equals (vo .getDescription (), key .description ()) || !ObjectUtils .equals (vo .getDefaultValue (), key .defaultValue ()) ||
192193 !ObjectUtils .equals (vo .getScope (), key .scope ().toString ()) ||
193- !ObjectUtils .equals (vo .getComponent (), componentName ) ||
194- (key .displayText () != null && !ObjectUtils .equals (vo .getDisplayText (), key .displayText ())) ||
195- (key .parent () != null && !ObjectUtils .equals (vo .getParent (), key .parent ())) ||
196- (key .group () != null && vo .getGroupId () != groupId ) ||
197- (key .subGroup () != null && vo .getSubGroupId () != subGroupId )) {
194+ !ObjectUtils .equals (vo .getComponent (), componentName )) {
198195 vo .setDynamic (key .isDynamic ());
199196 vo .setDescription (key .description ());
200- vo .setDisplayText (key .displayText ());
201197 vo .setDefaultValue (key .defaultValue ());
202198 vo .setScope (key .scope ().toString ());
203199 vo .setComponent (componentName );
200+ vo .setUpdated (date );
201+ configUpdated = true ;
202+ }
203+
204+ if (key .displayText () != null && !ObjectUtils .equals (vo .getDisplayText (), key .displayText ())) {
205+ vo .setDisplayText (key .displayText ());
206+ configUpdated = true ;
207+ }
208+
209+ if (key .parent () != null && !ObjectUtils .equals (vo .getParent (), key .parent ())) {
204210 vo .setParent (key .parent ());
211+ configUpdated = true ;
212+ }
213+
214+ if (key .group () != null && vo .getGroupId () != groupId ) {
205215 vo .setGroupId (groupId );
216+ configUpdated = true ;
217+ }
218+
219+ if (key .subGroup () != null && vo .getSubGroupId () != subGroupId ) {
206220 vo .setSubGroupId (subGroupId );
207- vo .setUpdated (date );
221+ configUpdated = true ;
222+ }
223+
224+ if (configUpdated ) {
208225 _configDao .persist (vo );
209226 }
210227 }
@@ -285,9 +302,6 @@ private Pair<Long, Long> getConfigurationGroupAndSubGroupByName(String configNam
285302 if (nameWords .length > 0 ) {
286303 for (int index = 0 ; index < nameWords .length ; index ++) {
287304 ConfigurationSubGroupVO configSubGroup = _configSubGroupDao .findByName (nameWords [index ]);
288- if (configSubGroup == null ) {
289- configSubGroup = _configSubGroupDao .startsWithName (nameWords [index ]);
290- }
291305
292306 if (configSubGroup == null ) {
293307 configSubGroup = _configSubGroupDao .findByKeyword (nameWords [index ]);
0 commit comments