Skip to content
Advertisement

Tag: hibernate

How to use Criteria in JPA in Spring boot?

I am using JPA and spring boot. I am new to JPA. I want to retrieve an object by passing the value of the function. But in example, it is done through hibernate config. I have not config sessionFactory bean in my classpath. I want to use JPA to retrieve the object. Here in the example, it is: But I

Can a Hibernate Search FieldBridge configure facets for dynamic fields?

Using Hibernate Search 5.11.3 with programmatic API (no annotations), is there a way to facet on dynamic fields added in a class or field bridge? I don’t see any ‘facet’ config available in FieldMetadataBuilder when using MetadataProvidingFieldBridge. I have tried various combinations of luceneOptions.addSortedDocValuesFieldToDocument() and luceneOptions.addFieldToDocument() in the set() method. This successfully updates the index, but I cannot perform facet

Primary key values are getting updated in Spring boot

I have created a maven project using Spring Boot with MySQL database. I have two entity classes that have a primary key in one entity class and another one has a composite primary key. Customer.java(Has a primary key) ItemId.java (Idclass for Item.java) Item.java (Has a composite primary key) here the problem is when an entity object is persisted through repository

Cannot instantiate Session Factory in Spring Boot Application

Whenever I run Spring boot app, I got following errors about EntityManagerFactory and SessionFactory which results in Spring error with current stack trace below: Classes: Main: Configuration class: How can I fix that? What is the problem with creating the beans? I cannot find any information about this problem Dependencies for Hibernate and Spring are below: Hibernate -> 5.4.1.Final Spring

Pom.xml and Properties for org.springframework.boot 2.1.8.RELEASE Redshift Cluster V1.0.10393

The first error I’m getting Invalid operation: SQL command “drop sequence if exists hibernate_sequence” not supported Further down in the exceptions I see the following. I assume I have to change the way indexes are incremented in hibernate_sequence. While building a java Spring Boot application, seeking to connect to and create a new redshift DB Cluster V1.0.10393. What are the

How to inject spring beans into the hibernate envers RevisionListener

I am using Spring 5.1 and Hibernate 5.3.9 including hibernate-envers. I don’t know how to inject spring beans into the hibernate envers custom RevisionListener. I have tried Of course the class is included in the @ComponentScan packages resolution. A problem is that myService is not injected into the listener. In the hibernate-envers documentation: https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#envers-basics As of Hibernate Envers 5.3, dependency

Error creating bean with name ‘entityManagerFactory’ defined in class path resource (Invocation of init method failed)

When I try to run my spring-boot project with hibernate and MySql, I got following error. My application.properties In pom.xml I have following dependencies, and my Course model looks like below, I also referred previous questions(Error creating bean with name ‘entityManagerFactory’ defined in class path resource : Invocation of init method failed) regarding this issue, But nothing helps. Full code

Set default Transaction Manager in @Transactional annotations?

I have a Spring Boot 2.x application with JPA/Hibernate and 2 separate Transaction Managers: 1 per-tenant and 1 application-wide. All entities, repositories and services are separated in different packages. Whenever I use @Transactional in my services, I need to explicitly qualify the txManager as either @Transactional(value = “tenantTransactionManager”) or @Transactional(value = “applicationTransactionManager”). This is very verbose and error prone since

Spring boot Mongo DB .yml configuration

When I use MySQL and hibernate for spring boot, I use below configuration in .yml file If it is mongoDB instead of MySQL and hibernate how does it change? Answer The mongodb properties are all prefixed with spring.data.mongodb. For user property you would use The list of available mongodb properties are here: You can find them at source for how

Advertisement