Revision eb1e36b8
Added by Andreas Müller over 1 year ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/validation/batch/BatchValidator.java | ||
---|---|---|
43 | 43 |
* @author ayco_holleman |
44 | 44 |
* @author a.mueller |
45 | 45 |
* @since 27 jan. 2015 |
46 |
* |
|
47 | 46 |
*/ |
48 | 47 |
@Component("batchValidator") |
49 | 48 |
public class BatchValidator implements Runnable, ApplicationContextAware { |
... | ... | |
73 | 72 |
validate(); |
74 | 73 |
} |
75 | 74 |
|
76 |
/** |
|
77 |
* |
|
78 |
*/ |
|
79 | 75 |
private void initValidator() { |
80 | 76 |
if (getValidator() == null){ |
81 | 77 |
HibernateValidatorConfiguration config = Validation.byProvider(HibernateValidator.class).configure(); |
... | ... | |
87 | 83 |
} |
88 | 84 |
} |
89 | 85 |
|
90 |
|
|
91 |
|
|
92 | 86 |
private <T extends ICdmBase, S extends T> void validate() { |
93 | 87 |
logger.info("Starting batch validation"); |
94 | 88 |
|
... | ... | |
130 | 124 |
|
131 | 125 |
} |
132 | 126 |
|
133 |
/** |
|
134 |
* @param readOnly |
|
135 |
* @return |
|
136 |
* |
|
137 |
*/ |
|
138 | 127 |
private TransactionStatus startTransaction(boolean readOnly) { |
139 | 128 |
PlatformTransactionManager txManager = getTransactionManager(); |
140 | 129 |
|
... | ... | |
145 | 134 |
return txStatus; |
146 | 135 |
} |
147 | 136 |
|
148 |
/** |
|
149 |
* @return |
|
150 |
*/ |
|
151 | 137 |
private PlatformTransactionManager getTransactionManager() { |
152 | 138 |
PlatformTransactionManager txManager = appContext.getBean(HibernateTransactionManager.class); |
153 | 139 |
return txManager; |
... | ... | |
162 | 148 |
} |
163 | 149 |
} |
164 | 150 |
|
165 |
|
|
166 |
/** |
|
167 |
* @param commonService |
|
168 |
* @param entityClass |
|
169 |
* @param entityValidationService |
|
170 |
* @param jdbcPersister |
|
171 |
* |
|
172 |
*/ |
|
173 | 151 |
private void handlePage(ICommonService commonService, Class<CdmBase> entityClass, IEntityValidationService entityValidationService, EntityValidationCrudJdbcImpl jdbcPersister, int start, int pageSize) { |
174 | 152 |
|
175 | 153 |
List<CdmBase> entities; |
... | ... | |
298 | 276 |
public void setValidationGroups(Class<?>... validationGroups) { |
299 | 277 |
this.validationGroups = validationGroups; |
300 | 278 |
} |
301 |
|
|
302 |
} |
|
279 |
} |
Also available in: Unified diff
cleanup