minor formatting work

This commit is contained in:
eugenp 2015-08-23 20:11:36 +03:00
parent c9aba4eeff
commit 4631f7e915
3 changed files with 4 additions and 5 deletions

View File

@ -8,10 +8,10 @@ import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.util.ReflectionUtils;
public class CascadeCallback implements ReflectionUtils.FieldCallback {
private Object source;
private MongoOperations mongoOperations;
public CascadeCallback(final Object source, final MongoOperations mongoOperations) {
this.source = source;
this.setMongoOperations(mongoOperations);

View File

@ -6,10 +6,10 @@ import org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventLis
import org.springframework.util.ReflectionUtils;
public class CascadeSaveMongoEventListener extends AbstractMongoEventListener<Object> {
@Autowired
private MongoOperations mongoOperations;
@Override
public void onBeforeConvert(final Object source) {
ReflectionUtils.doWithFields(source.getClass(), new CascadeCallback(source, mongoOperations));

View File

@ -26,7 +26,6 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = MongoConfig.class)
public class MongoTemplateQueryIntegrationTest {