Changeset 6733
- Timestamp:
- Feb 13, 2015, 12:55:05 PM (7 years ago)
- Location:
- trunk/src/core/net/sf/basedb/core
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/AnnotationType.java
r6728 r6733 144 144 } 145 145 146 /** 147 Load the IDs of all annotation types with the disable inheritance flag set. 148 This method will return all such IDs without checking permissions of the 149 current user. The returned set is not modifiable. 150 @since 3.5 151 */ 152 public static Set<Integer> getAllAnnotationTypesWithInheritanceDisabled(DbControl dc) 153 { 154 org.hibernate.Query query = HibernateUtil.createQuery(dc.getHibernateSession(), 155 "SELECT at.id FROM AnnotationTypeData at WHERE at.disableInheritance=true"); 156 return Collections.unmodifiableSet(new HashSet<Integer>(HibernateUtil.loadList(Integer.class, query, dc.getSessionControl()))); 157 } 158 146 159 AnnotationType(AnnotationTypeData annotationTypeData) 147 160 { -
trunk/src/core/net/sf/basedb/core/snapshot/SnapshotManager.java
r6728 r6733 51 51 52 52 private final Map<Integer, AnnotationSetSnapshot> snapshots; 53 private DisabledInheritanceFilter disabledInheritanceFilter; 53 54 54 55 /** … … 164 165 165 166 if (filter == null) filter = new StaticFilter<AnnotationSnapshot>(true); 167 166 168 // Needed for recursive searching of inherited annotations 167 AnnotationFilter annotationFilter = new AnnotationFilter(); 169 AnnotationFilter annotationFilter = null; 170 DisabledInheritanceFilter recursiveFilter = null; 171 if (searchInherited) 172 { 173 if (disabledInheritanceFilter == null) disabledInheritanceFilter = new DisabledInheritanceFilter(dc); 174 recursiveFilter = new DisabledInheritanceFilter(disabledInheritanceFilter); 175 annotationFilter = new AnnotationFilter(); 176 } 168 177 169 178 for (AnnotationSnapshot shot : snapshot.getAnnotations()) … … 181 190 if (recursive != null) 182 191 { 183 Filter<? super AnnotationSnapshot> recursiveFilter = filter;184 192 if (annotationId != 0) 185 193 { 186 194 // The main filter has already matched this annotation 187 195 // Use the recursive filter to load the specific annotation only 188 recursiveFilter = annotationFilter;189 196 annotationFilter.setAnnotationId(annotationId); 197 recursiveFilter.setParentFilter(annotationFilter); 190 198 } 199 else 200 { 201 recursiveFilter.setParentFilter(filter); 202 } 203 191 204 for (AnnotationSnapshot primary : findAnnotations(dc, recursive, recursiveFilter, false)) 192 205 {
Note: See TracChangeset
for help on using the changeset viewer.