Changeset 6968
- Timestamp:
- Oct 2, 2015, 11:36:10 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/log/db/AnnotationLogger.java
r6875 r6968 25 25 import org.hibernate.Query; 26 26 27 import net.sf.basedb.core.Annotation; 27 28 import net.sf.basedb.core.Item; 28 29 import net.sf.basedb.core.LogControl; … … 34 35 import net.sf.basedb.core.data.ChangeHistoryDetailData; 35 36 import net.sf.basedb.core.data.LoggableData; 37 import net.sf.basedb.core.data.ParameterValueData; 36 38 import net.sf.basedb.core.log.ChangeType; 37 39 import net.sf.basedb.core.log.EntityDetails; 38 40 import net.sf.basedb.core.log.EntityLogger; 39 41 import net.sf.basedb.core.log.LogManager; 42 import net.sf.basedb.core.plugin.ParameterValues; 40 43 import net.sf.basedb.util.Values; 41 44 import net.sf.basedb.util.formatter.Formatter; … … 139 142 change.setItemId(parentId); 140 143 change.setItemType(parentType); 141 change.setChangeInfo("Annotation["+annotationType+"]"); 144 Annotation.Source source = Annotation.Source.values()[annotation.getSource()]; 145 if (source == Annotation.Source.CLONED) 146 { 147 change.setChangeInfo("ClonedAnnotation["+annotationType+"]"); 148 } 149 else if (source == Annotation.Source.INHERITED) 150 { 151 change.setChangeInfo("InheritedAnnotation["+annotationType+"]"); 152 } 153 else 154 { 155 change.setChangeInfo("Annotation["+annotationType+"]"); 156 } 142 157 if (factory.isLoggingOldPropertyValues() && !disableLogOfValues) 143 158 { … … 151 166 f = EntityDetails.DATETIME_FORMAT; 152 167 } 153 String newValues = Values.getString(annotation.getValues().getValues(), ", ", true, f); 154 String oldValues = Values.getString(annotation.getValues().getOldValues(), ", ", true, f); 155 change.setNewValue(newValues.length() == 0 ? null : newValues); 156 change.setOldValue(oldValues.length() == 0 ? null : oldValues); 168 ParameterValueData<?> values = annotation.getValues(); 169 if (values != null) 170 { 171 String newValues = Values.getString(values.getValues(), ", ", true, f); 172 String oldValues = Values.getString(values.getOldValues(), ", ", true, f); 173 change.setNewValue(newValues.length() == 0 ? null : newValues); 174 change.setOldValue(oldValues.length() == 0 ? null : oldValues); 175 } 157 176 } 158 177 ((DbLogManager)logManager).logChangeDetails(change, details);
Note: See TracChangeset
for help on using the changeset viewer.