spring-data

How to serialize/deserialize a map with Solr/Lucene?

感情迁移 提交于 2019-12-25 02:55:57
问题 I am new to solr, and I am facing a problem when I try to serialize/deserialize a Map in Solr. I use Spring Data Solr in my Java application as follow: @Field("mapped_*") private Map<String, String> values; It flatten and serializes my map in Solr as follow: "key1" : "value1" "key2" : "value2" ... However, when I run a search, the returned objects have this field always set as NULL. Deserialization does not work on this particular field, it looks like it does not recognize the key1, key2...

Spring data: Autowire JpaRepository (Generic type)

我是研究僧i 提交于 2019-12-25 02:46:14
问题 I have a service (for generic type) which uses findAll() function of JpaRepository. public class SomeService<EntityClass>{ @Autowired JpaRepository<EntityClass> repository; JpaRepository getRepository(){} } But it gives this error: No qualifying bean of type [org.springframework.data.jpa.repository.JpaRepository] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations Is there any way to construct JpaRepository

Hibernate 5.x and Spring Data 2.x : how to make the original object updated in a service save method

谁说我不能喝 提交于 2019-12-25 00:39:21
问题 I am upgrading a web application from: Spring (MVC) 4.2.9.RELEASE, Hibernate 4.3.8.Final, and 1.7.1.RELEASE to Spring (MVC) 5.0.2.RELEASE, Hibernate 5.2.12.Final, and Spring Data 2.0.2.RELEASE. The web application runs on Windows and MS SQL Server 2014 Enterprise. The upgrade did not force me to change the settings for Hibernate and JPA. However, now the program behaves very differently, which is explained below. The following is a typcial service method in the application, which saves a new

How to query on a subset of composite primary key with @EmbeddedId or @Id key object (without using IdClass)? [duplicate]

拈花ヽ惹草 提交于 2019-12-24 23:57:31
问题 This question already has answers here : How to query on subset of composite primary key? (2 answers) Closed 2 years ago . How does Spring Data JPA support querying on a subset of a primary key ? Or will I need to implement a custom repository method for this? With classes like so: @lombok.Data @lombok.NoArgsConstructor @lombok.AllArgsConstructor @Entity @Table(name = "my_entity") class MyEntity { @EmbeddedId private Pk id; public Pk getId() { return id; } public void setId(Pk id) { this.id =

spring jpa custom repository not working

亡梦爱人 提交于 2019-12-24 22:45:24
问题 Trying to create a custom repository implementation with spring and getting the following error: caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.mynamespace.domain.repository.GenericRepositoryImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} Here is my code (download it from

Exception thrown when connecting Neo4j+HA and Spring Data"org.neo4j.kernel.extension.KernelExtensions@3b756db3'

对着背影说爱祢 提交于 2019-12-24 21:27:56
问题 I am trying to create a sample node in Neo4j Graph DB but getting an exception when starting tomcat. I am using Neo4j+HA+Spring Data Graph Repository to create a node. I am sure there is something wrong on how I configured. I am getting below exception. All my 3 neo4j clusters are configured and started.I used exact configuration as specified in the link Neo4j HA Conf Tutorial Let me know if you want me to paste any of other code/classes. I also see that "org.neo4j.kernel

Spring Data REST call to `save` receiving object with null variable

你说的曾经没有我的故事 提交于 2019-12-24 19:12:24
问题 I'm continuing the development of a system that uses the React JavaScript library (and related stuff) on the front end and Spring Data REST, Hibernate, PostgreSQL and related stuff on the back end. This system will be used by people who may own one or more companies and their clients. This means that most/all model objects will have a reference to the Company (ies) that they belong to. Also, company owners will have a few Employee s that will have higher level access on this system (or these

Multiple datasources with same repositories and entities

折月煮酒 提交于 2019-12-24 19:08:51
问题 I have a current requirement of allowing multiple data sources for the same repositories/entities in spring boot using jpa. What I've managed to find was always related to multiple datasources, with multiple repositories/entites. However, here I would like to have the same repositories and entities (ie same database structure) for multiple datasources. And based on same property, programmatically activate a specific datasource. I've tried the setup demo'ed here: https://github.com/spring

Spring MVC Error: Failed to convert property value of type java.lang.String to required type

时间秒杀一切 提交于 2019-12-24 18:43:36
问题 I can't let this exception go: Failed to convert property value of type java.lang.String to required type com.company.springdemo.entity.Product for property productId; nested exception is java.lang.IllegalStateException: Cannot convert value of type java.lang.String to required type com.company.springdemo.entity.Product for property productId: no matching editors or conversion strategy found Order Model @Entity @Table(name = "orders") // naming the table only order, will throw exception

ArangoDB, Java, Velocypack error trying to deserialize a DBEntity

▼魔方 西西 提交于 2019-12-24 18:42:31
问题 I'm using SpringBoot 1.5.4.RELEASE, ArangoDB java driver 4.5.0, Arango Spring Data 1.1.5 I'm getting this error when retrieving an object. com.arangodb.velocypack.exception.VPackParserException: java.lang.InstantiationException: com.arangodb.springframework.core.convert.DBEntity I can't find the root cause yet (still looking) but I can see where the error is being thrown, in the class VPack there is this method private <T> T createInstance(final Type type) throws InstantiationException,