spring-data

Errors of the Cineasts examples of Spring data neo4j

独自空忆成欢 提交于 2020-01-03 05:07:09
问题 I imported the cineast maven project to eclipse, but I face a configuration problem... cvc-complex-type.4: Attribute 'base-package' must appear on element 'neo4j:config' Below are the configuration files which have this error. ApplicationContext.xml <?xml version="1.0" encoding="UTF-8" standalone="no"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:neo4j="http

Errors of the Cineasts examples of Spring data neo4j

亡梦爱人 提交于 2020-01-03 05:07:04
问题 I imported the cineast maven project to eclipse, but I face a configuration problem... cvc-complex-type.4: Attribute 'base-package' must appear on element 'neo4j:config' Below are the configuration files which have this error. ApplicationContext.xml <?xml version="1.0" encoding="UTF-8" standalone="no"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:neo4j="http

Spring Data Repository caching results

只愿长相守 提交于 2020-01-03 04:50:11
问题 I am a complete spring data noob. I have an interface as follows public interface UserBalanceRepository extends PagingAndSortingRepository<UserBalance, Integer> { @Cachable("UserList") @Query("select userId from UserBalance") List<Integer> ListUserIds(Pageable pageable); } My cache configuration looks like this: <cache:annotation-driven /> <!-- generic cache manager --> <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager"> <property name="caches"> <set> <bean

spring cache with custom cacheResolver

▼魔方 西西 提交于 2020-01-02 23:15:08
问题 I wand to have dynamic cache names, and spring 4.1 allows that Since Spring 4.1, the value attribute of the cache annotations are no longer mandatory since this particular information can be provided by the CacheResolver regardless of the content of the annotation. Notice how I paranoidly set cacheResolver on all possible levels: @Cacheable(cacheResolver = "defaultCacheResolver") @CacheConfig(cacheResolver = "defaultCacheResolver") public interface GatewayRepository extends CrudRepository

Unable to find neo4j-cypher-dsl version 1.9.M04 anywhere

佐手、 提交于 2020-01-02 22:07:09
问题 org.springframework.data:spring-data-neo4j:2.2.1.RELEASE depends on neo4j-cypher-dsl:org.neo4j:1.9.M04 but I am unable to find this dsl artifact in any public mvn repositories. Any idea on where to get this jar? 回答1: Found this in neo4j repo here http://m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-cypher-dsl/1.9.M04/ 来源: https://stackoverflow.com/questions/16653128/unable-to-find-neo4j-cypher-dsl-version-1-9-m04-anywhere

How to use repository populator with spring data -jpa?

纵饮孤独 提交于 2020-01-02 14:32:20
问题 I am using Spring Data JPA and I am trying to use the repository populators to fill data - but I get an exception of malformed json. I think it may be the location of the data.json file. I have placed that in the META-INF folder and am configuring for a test case as follows @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:META-INF/integration-test-context.xml","classpath:META-INF/sample-data.xml"}) public class JpaCompanyRepositoryIntegrationTest{ //Test

How to use repository populator with spring data -jpa?

北城余情 提交于 2020-01-02 14:32:14
问题 I am using Spring Data JPA and I am trying to use the repository populators to fill data - but I get an exception of malformed json. I think it may be the location of the data.json file. I have placed that in the META-INF folder and am configuring for a test case as follows @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:META-INF/integration-test-context.xml","classpath:META-INF/sample-data.xml"}) public class JpaCompanyRepositoryIntegrationTest{ //Test

How do I expose a new REST method to through a Spring Data MongoDB repository with ALPS/HATEOAS metadata?

帅比萌擦擦* 提交于 2020-01-02 08:47:28
问题 How do I expose a new method in a MongoRepository extension class to the generated REST API and include the same ALPS/HATEOAS metadata, links etc. I have the usual Spring Data MongoDB repository: public interface CollectionRepository extends Repository<Collection, String> { // Simple queries Collection findFirstByName(@Param("name") String name); } Now I want to add another method and have it integrate into the generated Repository REST API so that it is included in the {repository}

Spring Data Neo4j Pageable

自古美人都是妖i 提交于 2020-01-02 07:15:19
问题 I have a Spring Data Repository interface that gets a collection of nodes from by database using a custom query: Repository Method: @Query ("START r = node({0}) MATCH r <-[:AUTHOR]- m RETURN m") public Page<Object> findObjectById (long objectId,Pageable pageable); Method call custRepository.findObjectById (4,new PageRequest(0, 5)); This return a collection of Objects, however the Page information is incorrect. There is enough data in database for me to get several pages of data. The first

Spring querydsl predicate: relationship support

不羁岁月 提交于 2020-01-01 18:54:50
问题 I have a Client entity with an OneToOne relation with Contact. If I want to get the client name, I need to write: client.getContact().getLastName() I use querydsl lib to filters client list in my spring boot app /api/clients?contact.lastName=Doe My controller signature: public ResponseEntity<ResponseListDTO> getClients ( @QuerydslPredicate(root = Client.class) Predicate predicateClient, Pageable pageable) It works well: predicate is well created and filters works. But now I need to filter on