I need to retrieve distinct LocalDate from LocalDateTime in database. I can use Spring data JPA or SQL native query.
databaseanswers.net Latest Questions
I am working on a Spring application which has an existing mongo collection with a huge amount of data. I need to create an index on that collection. I will use Mongobee/Mongock like migration framework to create the index. I ...
I am new to Spring Boot and I saw a concept of DAO or JPA that helps us to use Relational databases. But in my case I want to use mongo-DB so is there a particular design pattern with spring ...
In my entity class, I want to change the data type of a field but it’s not updating in the database. I am using PostgreSQL. I have also tried adding this: spring.jpa.hibernate.ddl-auto=update in application properties and still, it doesn’t work I don’t ...
I have this: A field which is a map where the keys are UUIDs and the value another object which is not relevant. A list of UUIDs that should be passed as parameter. I want to: delete from the collection all documents where all ...
db.getCollection(‘notification’).find({},{statusList:{$slice:-1}}) this query is getting expected outputs but from java, I could not find the solution for this. can anyone have a solution for this? I want to use only the aggregation function
Override and call super I’d like to override the save function and internally call it. public interface DataRepo extends MongoRepository<Data, String> { @Query("{'hash' : ?0}") List<Data> findDataByHash(String hash); default Boolean isHashSaved(String hash) { ...
I’m working on a Spring Boot application and it has to use a database. I can run the database locally and connect to it without problems but now I’m trying to run just the database in a Docker container and ...
every time when I make tables in MySQL using spring boot jpa I face the same problem that is the @Columns I specified in the @Entity Class will ordered differently on the database can any one help with that thank ...
I want to embed date information in the primary key, for a table that will be partitioned (monthly) in a PostgreSQL database. This should in theory speed up the process on finding out in which partition to look for the ...