Skip to content
Advertisement

Tag: spring-data

Spring Data MongoDB Annotation @CreatedDate isn’t working, when ID is assigned manually

I’m trying to use auditing to save dateCreated and dateUpdated in my objects, but since I set ID manually, there’s some additional work. Following Oliver Gierke’s suggestion in DATAMONGO-946 I’m trying to figure out how to correctly implement it. As original poster in Jira task above, I’ve downloaded example from here https://github.com/spring-guides/gs-accessing-data-mongodb.git and modified it a bit: and and a

Spring Data Rest – Soft Delete

I’ve been using spring data rest without any problem but now I have a requirement that when a user performs a DELETE operation on a given entity i.e. DELETE /accounts/<id> I need to set a flag on the database marking that entity as deleted but i do want to keep the record. Basically this means that I need to do

How to inject multiple JPA EntityManager (persistence units) when using Spring

I need to use one database for queries (non-modifying) and one for commands (modifying). I am using Spring Data JPA, so I have two configuration classes: In my repository I sometimes need to decide with EntityManager to use like so: I am using persistence unit’s name as defined in my persistence.xml: Spring throws org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘persistence.reading’ is defined.

What is the difference between Transaction manager and Entity Manager

As a student, i read nearly all spring documentation. As far as i understood that spring is configuration monster. Annotation based or Xml based, it doesn’t matter but what i really don’t understand is what is the difference between transaction manager and entity manager. If we have injected entityManager on Dao layer, why do we need transaction manager on service

Spring data mongodb. Generating id’s error

I have made an experiment… one common entity for two Spring data’s repositories: – JPA – MongoDB first of all I’ using following libraries versions: spring-data-jpa : 1.7.0.RELEASE spring-data-mongodb : 1.6.0.RELEASE I have an Entity: JPA Repository has following look: MongoDB repository has following look: package ua.home.springdata.investigation.repository.mongo; So… JPA works 🙂 Nothing special 🙂 But MongoDB test is not passed

Advertisement