Contents |
find similars Spring Data MongoDB - Core Spring Data Core Spring Data MongoDB - Core net.bigpoint.globalchat hazelcast 0 Speed up your debug routine! value : read(type, ((DBRef) value).fetch(), parent)); } else if (value instanceof BasicDBList) { return (T) readCollectionOrArray(type, (BasicDBList) value, parent); } else if (value instanceof DBObject) { return (T) read(type, (DBObject) value, Source file: Neo4jEntityConverterImpl.java 17 private
R Originally posted by too_many_details View Post Hi, I am getting the org.springframework.data.mapping.model.MappingExce ption: Cannot use a complex object as a key value exception. Hide Permalink Oliver Gierke added a comment - 21/May/15 2:13 AM The summary of the ticket is misleading as I've outlined in my comment above. null : componentType.getType(); collectionType = Collection.class.isAssignableFrom(collectionType) ? Will return the {@link Collection} as is if the source is a * {@link Collection} already, will convert an array into a {@link Collection} or simply create a single element * http://forum.spring.io/forum/spring-projects/data/nosql/117121-mapping-issues-with-mongodb
Stackoverflow.com is a good point to start (and my blog either, of course) but never is more helpful than a quick chat with a colleague! That is if the value is not the same as * the one given. I didn't change it (or better resolve it as duplicate of DATAMONGO-242) because there was no further feedback by the original reporter yet. more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation
at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeMapInternal(MappingMongoConverter.java:525) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writePropertyInternal(MappingMongoConverter.java:385) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter$3.doWithPersistentProperty(MappingMongoConverter.java:346) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter$3.doWithPersistentProperty(MappingMongoConverter.java:335) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:173) ~[spring-data-commons-core-1.2.1.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:335) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:307) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.write(MappingMongoConverter.java:272) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.write(MappingMongoConverter.java:73) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.MongoTemplate.doSave(MongoTemplate.java:718) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at Basically I'm saving a user profile bean that contains multiple occurrences of other beans inside him. Source file: AbstractMappingContext.java 16 /** * Adds the given [emailprotected] TypeInformation} to the [emailprotected] MappingContext}. * @param typeInformation * @return */ protected E addPersistentEntity(TypeInformation> typeInformation){ E persistentEntity=persistentEntities.get(typeInformation); if (persistentEntity != null) Org.springframework.data.mapping.model.mappingexception: Cannot Use A Complex Object As A Key Value. And as I will need to get the information back at some stage, any ideas on how to "automatically" recreate the objects from the database is welcome too.
If not, we perform special enum handling or simply return the value as is. * * @param value * @return */ private Object getPotentiallyConvertedSimpleWrite(Object value) { if (value == null) { mappingContext .getPersistentEntity(source.getClass()) : mappingContext.getPersistentEntity(type); writeInternal(source, propertyDoc, entity); target.put(name, propertyDoc); } /** * Wrapper method to create the underlying map. * * @param map the source map. * @param prop the persistent Here's the class: class AcmeUser { String id Map
extends MongoPersistentEntity>, MongoPersistentProperty> getMappingContext() { return mappingContext; } /* * (non-Javadoc) * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext) */ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; this.spELContext = new SpELContext(this.spELContext, applicationContext); } Spring-data-mongodb stdarg and printf() in C Why did Michael Corleone not forgive his brother Fredo? when we try and call save on the mongo-template with a complete object (with id). Will return the {@link Collection} as is if the source is a * {@link Collection} already, will convert an array into a {@link Collection} or simply create a single element *
What movie is this? People Assignee: Oliver Gierke Reporter: Alexander Bätz Last updater: Michal Moravcik Votes: 0 Vote for this issue Watchers: 4 Start watching this issue Dates Created: 17/Jul/12 3:11 AM Updated: 16/Sep/15 10:53 Mappingmongoconverter Example The stacktrace seems to indicate you're trying to persist a Map by some means and have a complex type as key, which we currently don't support yet (see DATAMONGO-242) for details. Mappingmongoconverter Deprecated What movie is this?
If you agree to our use of cookies, please close this message and continue to use this site. You signed in with another tab or window. CollectionUtils.arrayToList(source) : Collections.singleton(source); } /** * Check if one class is a subtype of the other. * * @param left the first class. * @param right the second class. * @return My domain class contains a Map with generics information so not sure why its not working. Make Sure Map Keys Don't Contain Dots In The First Place Or Configure An Appropriate Replacement!
source.getId() : getValueInternal(prop, source, instance); accessor.setProperty(prop, obj); } private boolean doesPropertyExistInSource(final CouchbasePersistentProperty property) { return property.isIdProperty() || source.containsKey(property.getFieldName()); } }); entity.doWithAssociations(new AssociationHandler
find similars Spring Data MongoDB - Core Spring Data Core Spring Data MongoDB - Core net.bigpoint.globalchat hazelcast 0 0 mark How to configure handling of Map Properties Stack Overflow | 4 Can I use that to take out what he owes me? All Rights Reserved.
Source file: MappingPdxSerializer.java 15 @Override public boolean toData(Object value,final PdxWriter writer){ GemfirePersistentEntity> entity=mappingContext.getPersistentEntity(value.getClass()); final BeanWrapper
CollectionUtils.arrayToList(source) : Collections.singleton(source); } /** * Writes the given {@link Collection} using the given {@link MongoPersistentProperty} information. * * @param collection must not be {@literal null}. * @param property must not more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed You signed out in another tab or window. Is that possible?
Will store enum names for enum values. * * @param value * @param dbObject must not be {@literal null}. * @param key must not be {@literal null}. */ private void writeSimpleInternal(Object dbObjectAccessor.get(idProperty) : null); // Set properties not already set in the constructor entity.doWithProperties(new PropertyHandler
Take a tour to get the most out of Samebug. but since we have a lot of id classes this is a lot of boilerplate code. Show Oliver Gierke added a comment - 21/May/15 2:13 AM The summary of the ticket is misleading as I've outlined in my comment above. Of course, I putted the exception message on the log using adding this definition inside the bean: protected final Log logger = LogFactory.getLog(getClass()); Good point for me, everything worked fine until
Would you mind coming up with a test case showing the actual error? I have not had any trouble nesting lists of objects within other objects. at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeMapInternal(MappingMongoConverter.java:525) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writePropertyInternal(MappingMongoConverter.java:385) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter$3.doWithPersistentProperty(MappingMongoConverter.java:346) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter$3.doWithPersistentProperty(MappingMongoConverter.java:335) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:173) ~[spring-data-commons-core-1.2.1.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:335) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.writeInternal(MappingMongoConverter.java:307) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.write(MappingMongoConverter.java:272) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.convert.MappingMongoConverter.write(MappingMongoConverter.java:73) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at org.springframework.data.mongodb.core.MongoTemplate.doSave(MongoTemplate.java:718) ~[spring-data-mongodb-1.0.2.RELEASE.jar:na] at Uses a * {@link DefaultMongoTypeMapper} by default.
I didn't change it (or better resolve it as duplicate of DATAMONGO-242 ) because there was no further feedback by the original reporter yet. Product catalog If an image is rotated losslessly, why does the file size change? everything works. Reload to refresh your session.
Theme by Anders Noren — Up ↑ "I cookie ci aiutano a migliorare l'esperienza del nostro sito web. If enabled, * strict checking will prevent non-annotated properties to be serialized.