Questions tagged [hibernate]

Hibernate is a sophisticated object-relational mapping (ORM) tool developed specifically for Java developers. With Hibernate, programmers can effortlessly incorporate POJO-style domain models into their applications, maximizing the potential of Object/Relational Mapping in diverse and innovative ways.

Does MySQL Workbench automatically convert camel case attributes?

I'm curious to understand something. I defined an attribute called userId, but in MySQL Workbench it shows up as user_id. Is this usual? @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name= "userId") private Lon ...

Utilizing PostgreSQL's JSON column to store and retrieve data in a Hibernate entity

I am currently facing a challenge with mapping a JSON column in my PostgreSQL DB (version 9.2) to a JPA2 Entity field type. Initially, I attempted to use String as the value type, but encountered an exception when attempting to save the entity due to a co ...

Encountered an issue while attempting to assess Jackson deserialization for this specific

I am currently in the process of establishing a many-to-many relationship between movies and users. However, I encountered an error while attempting to save a movie: 2017-12-01 16:12:43.351 WARN 17328 --- [nio-8090-exec-5] .c.j.MappingJackson2HttpMessageC ...

AngularJS Relationships with Hibernate

Working with two classes that have a one-to-one relation, I have successfully retrieved their data and displayed it in HTML using REST service and AngularJS. However, when attempting to display the airport ID on the asset page using {{asset.airport.id}}, n ...

Serialize custom objects with an array of custom objects using Spring Boot and JSON

Let's take a look at this interesting class structure: @Id @GeneratedValue(strategy=GenerationType.AUTO) private long id; private int key; private String text; private Tag[] tags; private String title; private boolean valid; public Activity(int key, Strin ...

Tips for persisting a JSON Object in PostgreSQL with Hibernate in Java

Looking for a way to save a JSON object in PostgreSQL database using Hibernate with Java. Although PostgreSQL offers json and jsonb data types, Hibernate doesn't have built-in mapping for these data types. Seeking guidance on how to proceed, I came across ...

What is the best way to verify the JSON request in a Spring Boot application?

I need to verify the JSON request I receive from the client side. Despite successfully using annotations like @notnull and @length(min=1,max=8), I am struggling to access the specific fields and error messages that are triggered when validation fails. Alth ...

Encountering issues in inserting data with duplicate IDs in a many-to-many relationship

I currently have a situation where I have two entities, Movie and Actor, that are linked together in a many-to-many relationship. Here is the definition of the Movie entity: public class Movie { @Id private String imdbId; @ManyToMany(cascade ...

Exception thrown due to lazy initialization of a eagerly fetched (detached) collection

Let's start with some details: My technology stack includes: Spring 3.1.1.RELEASE Hibernate 4.1.5.SP1 JSF 2.0? OpenSessionInViewFilter (org.springframework.orm.hibernate4.support.OpenSessionInViewFilter) PrimeFaces 3.3.1 Lombok 0.11.2 JBoss 7.1.1.Final ...

Error message indicating that the REST service response encountered an issue with java.io.IOException: UT010029 where the stream was

Having trouble with JSON conversion in a Spring Boot application? @Lob @Column(name = "attachment") private byte[] attachment; Are you encountering an exception like the following while working with REST services? If so, you may be facing issues with ...

problems related to pagination in a spring mvc application

My Spring MVC project utilizes display tag pagination and jQuery tabs. However, I'm facing an issue where when I try to paginate in any tab (for example, moving from page 1 to page 2), the page refreshes and the first tab becomes active again. (Meaning, ev ...

HttpErrorResponse: unexpected internal server error

Just getting started with Angular 6. I created a post service using Spring Boot, and it works perfectly when tested with Postman. But testing it in a web browser results in the following error: HttpErrorResponse {headers: HttpHeaders, status: 500, statusT ...

sending a JSON object from the controller to a JSP page

I need to transfer all the data from my database in the form of a JSON array to a JSP page so that it can be retrieved using AJAX. EmployeeController public class EmployeeController { @Autowired private EmployeeService employeeService; @RequestMapping( ...

Creating a secure @RestController that encrypts passwords and transmits data in JSON format using Hibernate

When developing a login/registration form in AngularJS and using Spring Boot, I encountered an issue with encrypting passwords into the database. After registering a user, my code for sending data to the database looked like this: @RequestMapping(value = ...

Attempting to save an object that references an unsaved transient instance - ensure the transient instance (com.example.model.Salutation) is saved before

I am facing an issue with saving User object containing a reference to the Salutation model class. Even though the Foreign key (salutation_id) in the User table is optional, I am encountering an error when trying to save the User object after merging and f ...

Reduce JSON for efficient deserialization and persistence of intricate POJOs using JPA/Hibernate

Dealing with deserialization of a complex POJO from a JSON string and persisting it in a MySQL database can be quite challenging. Below is a simplified example class: @Entity @Table(name="a") public class A{ private Long id; private B b; priva ...

Guide on using Ajax and spring MVC to dynamically fill a modal form

One JSP page displays database results in a table on the browser, allowing users to edit or delete each row. I want to implement a feature where clicking the edit link fetches specific customer data from the database using Spring MVC and Hibernate, display ...

Building a JSON tree model in a Spring application using a list

I'm struggling with JSON. I have a user_id from the client-side and need to check the groups associated with this user_id. After retrieving data from the database, I place it into a list. I have included this annotation in my xml file: <mvc:annotatio ...