Skip to content
Advertisement

Tag: hibernate

MappingJackson2HttpMessageConverter configuration is not being recognized in spring boot 2

I am working with spring for a while already and in my spring boot 1.5x’s projects always dealing with the LazyInitializationException with the next configuration (more downstairs) but now I am creating a new project with spring boot 2 and the same configuration is not being recognized further than WebMvcConfigurer now replace to the deprecated WebMvcConfigurerAdapter. My configuration: But after

What is the purpose of the Hibernate ReturningWork interface?

I am working on one JAVA + Hibernate project but currently, I saw one interface in my code (i.e. ReturningWork<Long>) which has one method called execute(java.sql.Connection). My question is what is the use of this ReturningWork interface? Answer As I explained in more details on my blog, you can use the ReturningWork and the Work interfaces to implement any logic

How to detach an entity from an EntityManager

My environment Java 7/JPA 2/Hibernate 5.1. My Scenario I’m building a Repository pattern implementation. All code is written and it all works fine when no error condition happens. However, let’s say that three entity instances are added to the repository. First and third are ok, but second lacks value for a mandatory (not null) column. A DB error will be

When running a project “Unsatisfied dependency expressed through constructor parameter 0”

When running a project, an error occurs: UnsatisfiedDependencyException: Error creating bean with name ‘sqlServerQueryDaoImpl’ defined in file SqlServerQueryDaoImpl.class : Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘javax.persistence.EntityManagerFactory’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} Code Dao DaoImpl my pom.xml stacktrace Answer Well, there are

Can’t register an custom Entity in Spring project

Hello I have custom entity which has fields like name, description, date ant others, I created EventRepository and EventServiceImpl. Also i have a model RegisterEvent. Event entity: EventRepository: EventServiceImpl: RegisterEvent Model But when i Try to register event in my Html : I get the following error: And in the browser shows: I don’t know whats happening in the error

Storing UUID as string in mysql using JPA

I came across a blog of using UUID with Hibernate and MySql. Now the problem is, whenever I take a look at the database the ID’s will be non-readable format (binary-16). How can I store UUID as a readable format like 7feb24af-fc38-44de-bc38-04defc3804fe instead of ¡7ôáßEN¹º}ÅÑs I was using this code And the result is ¡7ôáßEN¹º}ÅÑs. But I want it as

Advertisement