spring-data

What rules govern using @MOdify and @Query in JPA Repository?

被刻印的时光 ゝ 提交于 2019-12-24 07:31:12
问题 Now that my project is successfully completed, we are trying to document lessons learned. One that still confuses me is the following: We have a database of addresses, and needed to autocomplete when a User started typing in a street name. Using JPA repository, we implemented a PString class (simply a persistent wrapper for a String), and then implemented this interface: @RepositoryRestResource(collectionResourceRel = "locations", path = "locations") public interface LocationRepository

java.lang.NoSuchMethodError: org.springframework.beans.BeanUtils.findPropertyForMethod

落花浮王杯 提交于 2019-12-24 04:29:04
问题 I am getting below error while trying to configure spring data in my applciation. I am using spring data and EclipseLink, along with spring-security and oauth2. SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.NoSuchMethodError: org.springframework.beans.BeanUtils.findPropertyForMethod(Ljava/lang/reflect/Method;Ljava/lang/Class;)Ljava/beans/PropertyDescriptor; at org.springframework.orm.jpa

Spring Data JPA custom method causing PropertyReferenceException

为君一笑 提交于 2019-12-24 03:34:29
问题 I have been trying to create a spring boot application. In my application I would like to add some custom methods to save the data instead of using the default save method. My application entry point is something like this: @Configuration @ComponentScan @EnableJpaRepositories(repositoryImplementationPostfix = "CustomImpl") @Import(RepositoryRestMvcConfiguration.class) @EnableAutoConfiguration @PropertySource("application.properties") public class Application { public static void main(String[]

Spring Data REST Neo4j create a relationship

天大地大妈咪最大 提交于 2019-12-24 00:20:05
问题 I'm building a little test app as a way to learn Angular and refresh myself on a lot of the Spring stack. I have some minor experience with Neo4J, but the app idea has ground with a graph db like Neo4j. The idea is pretty simple, a ui to create characters and stories, and relate the characters to the stories and each other, map their individual versions of a story and create some graphs that show the character interactions to help write the overall narrative. I've got nodes for the characters

_class field and spring data couchbase

巧了我就是萌 提交于 2019-12-23 22:01:06
问题 So, I was trying to find a way to remove/rename( and change the fields value ) the _class field from the document generated by spring data couchbase as the document is going to be stored by one service and in all likeliness be consumed by someone totally different. I was playing around with the api for spring couchbase and through a bit of trial and error found that I can rename the _class field with a custom value using the following way -> 1) Override the typeKey method in a class

_class field and spring data couchbase

风格不统一 提交于 2019-12-23 21:20:58
问题 So, I was trying to find a way to remove/rename( and change the fields value ) the _class field from the document generated by spring data couchbase as the document is going to be stored by one service and in all likeliness be consumed by someone totally different. I was playing around with the api for spring couchbase and through a bit of trial and error found that I can rename the _class field with a custom value using the following way -> 1) Override the typeKey method in a class

Paging with Spring Data Graph/Neo4j

[亡魂溺海] 提交于 2019-12-23 19:12:00
问题 Is it possible to fetch Page results when using Spring Data Graph (Neo4J) as the data store? The findAll(Pageable) seems to be the only Pageable query availalble when using the GraphRepository . What I am looking for is Pageable APIs for other findBy***() like queries. Perhaps, there may be a completely different (recommended) way to Page results using Spring Data Graph. Thoughts on that are welcome as well! 回答1: Spring Data Neo4j (2.0 currently in SNAPSHOT but soon RC1) added Page support

Spring data mongodb field auto increment

那年仲夏 提交于 2019-12-23 18:57:56
问题 How can i make a field in collection incremented automatically ? @Document public class Product { @Id private BigInteger id; private String name; // need to be auto inc private int version; i use CrudRepository public interface ProductRepository extends CrudRepository<Product,BigInteger> { } i need to increment version in every creation of new product . example : {_id":"56d21eaeb61595413b3b3db7","name":"Prod 1", "version":"1"} {_id":"56d21eaeb61595413b3b3dbb","name":"Prod 2", "version":"2"}

Spring 3 autowire is always null

笑着哭i 提交于 2019-12-23 18:54:45
问题 I'm having difficultly getting what seems like a very basic auto wiring to occur. I'm trying to add another data source to our system for warehouse stuff, but I'm running in to an issue. I'm not an expert in Spring by an stretch, and I've been reading around on this issue, and it seems like I have everything setup correctly. I tried changing my component scan to also include the repositories, but that didn't fix the issue. I also tried @Resource with the bean name specified. It never throws

Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Expected 8 or 0 byte long for date (13)

混江龙づ霸主 提交于 2019-12-23 17:33:15
问题 I am trying to insert data with spring-data-cassandra. But I am getting bellow error , when my app is running with SpringBoot(version is 1.5.3) I add a custom CallHistoriyRespority object implemented CrudResposity in spring-data, and use the save method to insert the data object I can't find any reason and the problem confused me Full stack trace : Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Expected 8 or 0 byte long for date (13) at com.datastax.driver.core