spring-data

SpringDataJpa: Multiple ContainingIgnoreCase

落爺英雄遲暮 提交于 2020-01-25 00:35:07
问题 I have something like below. basically I want to get all the books contains certain keywords in their title or description. Spring keep giving me error on this method. Single select of either Title or Descr works, but I am just not able to put them together. What am I missing? works: findBookByTitleContainingIgnoreCase(String keyWord) findBookByDescrContainingIgnoreCase(String keyWord) doesn't work: findBookByTitleContainingIgnoreCaseOrDescrContainingIgnoreCase(String keyWord) 回答1: This will

Unknown persistent entity Error" after upgrade to 3.0.1.Release

别来无恙 提交于 2020-01-25 00:16:09
问题 Recently upgraded to Spring Neo4j 3.0.1.Release. I am now getting an Exception "MappingException: Unknown persistent entity". Not sure what could be causing this as I have not made any changes to the application. I have created a small test project to recreate the error message. You can download it from here - http://www.filebin.ca/1S2rAXPJE199/Store.zip Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService':

How to fix mongo index creation after update to Srping Boot 2.2?

走远了吗. 提交于 2020-01-24 22:07:55
问题 On the previous version of Spring Boot (2.1.9) everything worked fine. I'd updated it to 2.2.2.RELEASE (with dependency management plugin used), and have started to get an error: org.springframework.dao.DataIntegrityViolationException: Cannot create index for '' in collection 'testDTO' with keys 'Document{{_id=1, version=1}}' and options 'Document{{name=optimistic_concurrency_idx}}'.; nested exception is com.mongodb.MongoCommandException: Command failed with error 67 (CannotCreateIndex):

Spring-Data-Gemfire - Unable to contact a Locator service. Operation either timed out or Locator does not exist

本秂侑毒 提交于 2020-01-24 21:34:26
问题 I want to connect to a exist locator. Now I don't have client-server. I started a locator,port is 40001, server1 port is 40411. gfsh>list members Name | Id ------- | ---------------------------------------------- test1 | 192.168.1.106(test1:1880:locator):1024 server1 | 192.168.1.106(server1:7532):1025 Configuration is: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:gfe-data="http://www.springframework.org/schema/data/gemfire" xmlns:xsi=

Handling entities inheritance spring boot

匆匆过客 提交于 2020-01-24 21:10:30
问题 I'm working with this tutorial to handle entities inheritance. I have person and company entities that extends the User entity. @Entity @Inheritance public abstract class User { @Id private long id; @NotNull private String email; // getters and settres } @Entity public class Person extends User { private int age; // getters and settres and other attributs } @Entity public class Company extends User { private String companyName; // getters and settres and other attribut } then UserRpository

Spring HATEOAS - two same links

橙三吉。 提交于 2020-01-24 20:41:11
问题 lately I've been doing some projekt with Spring Data and Rest with HATEOAS. My question is, is it normal, that in entity links secion, I have 2 same links? Here is repository: Repository 回答1: Yes it is. But it's not always the case: the 'user' link is actually a templated link that gets enriched in certain cases. For instance, should you define the following projection: @Projection(name = "summary", types = { User.class }) interface Summary { String getUsername(); String getEmail(); } then

How to initialise/wire beans in Grails Spock unit tests?

倖福魔咒の 提交于 2020-01-24 12:50:06
问题 I'm wanting to test a Grails controller that contains a bean (I'll move it to a Service when I get it working, but I just want to keep it simple now). //resources.groovy beans { myBean(com.me.MyBean) } // MyBean.java // this needs to be in java as it is playing with spring-data-neo4j package com.me; public class MyBean { String show() { return "Hello"; } } // TestController.groovy package com.me import com.me.MyBean class TestController { def myBean def index() { render myBean.show() } } //

java.lang.IllegalArgumentException in Spring-data-Jpa

浪尽此生 提交于 2020-01-24 10:51:51
问题 I am getting an exception <code> Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditTrailRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: [Assertion failed] - this argument is required; it must not be null at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans

java.lang.IllegalArgumentException in Spring-data-Jpa

痴心易碎 提交于 2020-01-24 10:51:06
问题 I am getting an exception <code> Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auditTrailRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: [Assertion failed] - this argument is required; it must not be null at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans

SpringData Mongo @Column equivalent annotation (@Property?)

≯℡__Kan透↙ 提交于 2020-01-24 03:07:38
问题 Is there a SpringData Mongo equivalent of the JPA @Column annotation? Basically, I've got a POJO with a property that I want to store in Mongo with a different name. So, the following object: public class Pojo{ @Property("bar") private String foo = "Hello World"; } would be persisted as: { "_class":"com.example.Pojo", "bar" : "Hello World" } Note: I don't want to use the MappingMongoConverter to explicitly do it 回答1: The Spring Data reference documentation lists @Field as the annotation to