Comments (5)
Robert Stiller commented
I've forgot the siteService:
package example.service;
import org.springframework.data.document.mongodb.repository.MongoRepository;
import org.springframework.data.document.mongodb.repository.QueryDslPredicateExecutor;
import example.Site;
public interface SiteService extends MongoRepository<Site, String>, QueryDslPredicateExecutor<Site> {
}
from spring-data-commons.
Oliver Drotbohm commented
That should have been fixed with 54ada02. Could you please try a current snapshot?
from spring-data-commons.
Robert Stiller commented
I figured out, that i did not specify a "collection" attribute in the @DBRef
annotation.
It still does not work without it:
@Document(collection = "sites") //Doesn't work without the collection specified too
class Site {
...
@DBRef
protected Site parent;
...
}
But... if I specify the correct collection it works:
@Document(collection = "sites")
class Site {
...
@DBRef(collection = "sites")
protected Site parent;
...
}
I thought, that the object/class itself would be enough for @DBRef
to figure out the correct collection.
So this may be a future feature :D
You should refer this issue in the documentation or try to figure out the correct collection using the class of the field annotated - if not explicitly specified (don't forgot a debug-log-message for automatically determined collections)
from spring-data-commons.
Robert Stiller commented
I've got another issue:
public class MyObject {
...
protected Map<String, Attribute> attributes = new HashMap<String, Attribute>();
...
}
public class Attribute {
...
protected String name;
protected String value;
protected Map<String, Attribute> children = new HashMap<String, Attribute>();
...
}
This causes the introspection to be terminated by a StackOverflowError, too.
You may fix it by breaking introspection on fields with a type(class) already introspected or now being introspected in the responsible method ...
One should also prevent endless loops caused by circular references. A detection with the corresponding Exception would be fine
from spring-data-commons.
Oliver Drotbohm commented
I've tweaked the algorithm of AbstractMappingContext
a little so that it should now recognized already added PersistentEntity
instances on recursive invocations. Made some refactorings in the TypeInformation
part as well and added further tests to cover additional cases. Hope this one finally solves it for you (and us ;) )
from spring-data-commons.
Related Issues (20)
- Document converter types supported by `CustomConversions`
- Kotlin constructor detection fails during `KType` derivation HOT 1
- ReactiveCrudRepository.save is loosing Tracing context HOT 3
- Release 3.1.10 (2023.0.10)
- Release 3.2.4 (2023.1.4)
- Release 3.3 M2 (2024.0.0)
- Pagination / Sort support in http interface client
- How do I add converter from Instant to org.joda.time.DateTime to spring-data-commons-3.2.1 and spring-data-cassandra-4.2.1 HOT 1
- Add `ValueExpression` infrastructure for query methods
- `TypeDiscoverer` uses single-level nesting for generics comparison HOT 3
- Spring-Data-Commons Upgrade is causing MongoDB driver to throw CodecConfigurationException HOT 3
- Redunant code in DefaultEntityCallbacks#callback
- Auditing triggers unintended persistent entity creation for collection like types (List, Set,...) HOT 3
- Introduce standardized interfaces for published application events HOT 3
- Revert workaround for Java 8 `ConcurrentHashMap` bug HOT 1
- Add `equals`/`hashCode` support for `Unpaged` HOT 2
- Reference documentation has missing sections since latest release HOT 1
- Release 3.1.11 (2023.0.11)
- Release 3.2.5 (2023.1.5)
- Release 3.3 RC1 (2024.0.0)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-commons.