thank you Michael So we have to override neo4j version used by spring-data-neo4j 3.0.0.M1 when neo4j 2.0.1 is released
Le mardi 28 janvier 2014 16:49:44 UTC+1, Michael Hunger a écrit : > > There is a bug with unique indexes in 2.0 it will be fixed in 2.0.1 > > Sent from mobile device > > Am 28.01.2014 um 16:30 schrieb hamdi makni <[email protected]<javascript:> > >: > > Hi > > I'm using SDN 3.0.0.M1 with neo4j-2 server and I need to have indexed and > unique property. I use @Indexed(unique = true) annotation like that: > > @NodeEntity > public class Group{ > > > @Indexed(unique = true) String groupName > > > @GraphId > protected Long id; > ... > > > > > > with an empty database when I save a new entity with my > GroupRepository.save(new Group("PORTEUR")) I have this exception: > > > Caused by: org.springframework.dao.DataIntegrityViolationException: > Uniqueproperty > class java.lang.String groupName rel: false idx: true was to be set to > duplicate value PORTEUR > at org.springframework.data.neo4j.fieldaccess. > IndexingPropertyFieldAccessorListenerFactory$IndexingPropertyFieldAccessorListener > .addUniquely(IndexingPropertyFieldAccessorListenerFactory.java:94) > at org.springframework.data.neo4j.fieldaccess. > IndexingPropertyFieldAccessorListenerFactory$IndexingPropertyFieldAccessorListener > .valueChanged(IndexingPropertyFieldAccessorListenerFactory.java:84) > at org.springframework.data.neo4j.fieldaccess.DefaultEntityState. > notifyListeners(DefaultEntityState.java:137) > at org.springframework.data.neo4j.fieldaccess.DefaultEntityState.setValue > (DefaultEntityState.java:114) > at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter. > setEntityStateValue(SourceStateTransmitter.java:70) > at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter. > access$100(SourceStateTransmitter.java:40) > at org.springframework.data.neo4j.support.mapping. > SourceStateTransmitter$3.doWithPersistentProperty(SourceStateTransmitter. > java:105) > at org.springframework.data.neo4j.support.mapping. > SourceStateTransmitter$3.doWithPersistentProperty(SourceStateTransmitter. > java:102) > at org.springframework.data.mapping.model.BasicPersistentEntity. > doWithProperties(BasicPersistentEntity.java:261) > at org.springframework.data.neo4j.support.mapping.SourceStateTransmitter. > copyPropertiesTo(SourceStateTransmitter.java:102) > at org.springframework.data.neo4j.support.mapping. > Neo4jEntityConverterImpl.write(Neo4jEntityConverterImpl.java:167) > at org.springframework.data.neo4j.support.mapping. > Neo4jEntityPersister$CachedConverter.write(Neo4jEntityPersister.java:179) > at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister. > persist(Neo4jEntityPersister.java:243) > at org.springframework.data.neo4j.support.mapping.Neo4jEntityPersister. > persist(Neo4jEntityPersister.java:231) > at org.springframework.data.neo4j.support.Neo4jTemplate.save( > Neo4jTemplate.java:308) > at org.springframework.data.neo4j.support.Neo4jTemplate.save( > Neo4jTemplate.java:302) > at org.springframework.data.neo4j.repository.AbstractGraphRepository.save > (AbstractGraphRepository.java:115) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.springframework.data.repository.core.support. > RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn( > RepositoryFactorySupport.java:358) > at org.springframework.data.repository.core.support. > RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke( > RepositoryFactorySupport.java:343) > at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( > ReflectiveMethodInvocation.java:179) > at org.springframework.transaction.interceptor.TransactionInterceptor$1. > proceedWithInvocation(TransactionInterceptor.java:98) > at org.springframework.transaction.interceptor.TransactionAspectSupport. > invokeWithinTransaction(TransactionAspectSupport.java:262) > at org.springframework.transaction.interceptor.TransactionInterceptor. > invoke(TransactionInterceptor.java:95) > at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( > ReflectiveMethodInvocation.java:179) > at org.springframework.dao.support. > PersistenceExceptionTranslationInterceptor.invoke( > PersistenceExceptionTranslationInterceptor.java:136) > at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed( > ReflectiveMethodInvocation.java:179) > at org.springframework.aop.framework.JdkDynamicAopProxy.invoke( > JdkDynamicAopProxy.java:207) > at com.sun.proxy.$Proxy47.save(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.springframework.aop.support.AopUtils. > invokeJoinpointUsingReflection(AopUtils.java:317) > at org.springframework.aop.framework.JdkDynamicAopProxy.invoke( > JdkDynamicAopProxy.java:201) > at com.sun.proxy.$Proxy48.save(Unknown Source) > at com.rfs.applications.roopec.core.identity.services.IdentityServiceImpl > .addGroup(IdentityServiceImpl.java:189) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > > > > > Is it a bug on SDN or bad config on my app? > > > my config: > > <tx:annotation-driven mode="proxy"/> > > > <neo4j:config graphDatabaseService="graphDatabaseService"/> > > > <neo4j:repositories base-package="com.sfr.applications.cooper.core" /> > > > <bean id="typeRepresentationStrategyFactory" class= > "org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory" > > > <constructor-arg index="0" ref="graphDatabaseService"/> > <constructor-arg index="1"> > <value type= > "org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory$Strategy" > >Labeled</value> > </constructor-arg> > </bean> > > > <bean id="restGraphDatabaseService" > class= > "org.springframework.data.neo4j.rest.SpringRestGraphDatabase"> > <constructor-arg index="0" value="http://localhost:7474/db/data" > /> > </bean> > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
