Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using @Field("foo") with @Dbref breaking behavior. [DATAMONGO-1058] #1979

Closed
spring-projects-issues opened this issue Sep 18, 2014 · 3 comments
Closed

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Sep 18, 2014

Allan Chiou opened DATAMONGO-1058 and commented

When transitioning from 1.4.3.RELEASE to 1.6.0.RELEASE, the model below no longer returns with map

Model

@Document(collection="model")
class Model {
	@Id
	ObjectId id;
        
/**
* Currently only works without @Field annotation
*/
    @Field("foo")
	@DBRef
	Map<String, Foo> mapOfFoos ; //assume Foo is a class
}

Repo

public interface ModelDao extends MongoRepository<Model, ObjectId> {
}

public interface FooDao extends MongoRepository<Foo, ObjectId> {
}

Snippet of a unit test

...
Model model = new Model();
Map<String, Foo> mapOfFoos = new HashMap<String, Foo>();
Foo foo = new Foo()
fooDao.save(foo)
mapOfFoo("somestring", foo)
model.setMapOfFoos(mapOfFoo)
modelDao.save(model);
Model  retreivedModel = modelDao.findOne(model.getId());
//retreivedModel.getMapOfFoos() returns null
//EXPECTED (and previous behavior) retreivedModel.getMapOfFoos() not null

Affects: 1.6 GA (Evans)

Reference URL: http://stackoverflow.com/questions/25971669/springdata-mongodb-field-sometime-works-sometime-not

Referenced from: pull request #227

Backported to: 1.6.1 (Evans SR1), 1.5.5 (Dijkstra SR5)

1 votes, 3 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 24, 2014

Christoph Strobl commented

Should be back ported to 1.6.x.
Can be back ported to 1.5.x. Minor glitches there but still can be done

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 30, 2014

Thomas Darimont commented

Merged into master.

Backports to be discussed

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 1, 2014

Thomas Darimont commented

Back ported to 1.6.x and 1.5.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants