Browse all latest questions tagged Jpa
I am using: Hibernate 4.3.5 Spring JPA 1.6.0 Javax Persistence API 2.1 The "refcodemailing" column is defined as an array of int: int[] My entity object: @Entity @Table public class CalendarEven...
I'm using OpenShift, and I'm trying to deploy my application to a local Tomcat instance for faster development. I'm using EclipseLink for DB transactions, and I've provided the environment variables O...
I want to write a select statement but can't figure out how to write the where clause... My code: CriteriaQuery query = entityManager.getCriteriaBuilder().createQuery(); query.select(query.from(Secu...
here i am trying out many-to-many relationship in JPA, I'v created tables "tblcourse" and "tblStudent", a student can register to many courses, create table tblcourse( id integer primary key,...
I'm doing a simple exercise to learn JPA. When I try to delete an entity of type User, which has a Collection of the other entity Score (annotated with @OneToMany) I get this error: java.sql.SQLInteg...
I have an entity called Task and it has taskId field. Problem is I need to create/update some specific tasks and JPA autogenerator doesn't allow me to set taskId manually.(It overrides my taskId) Is...
Let's say I have the following method in a JpaRepository: @EntityGraph(value = "Subject.allJoins", type = EntityGraphType.FETCH) @Query("select s from Subject s" + FIND_QUERY_WHERE) Page<S...
Let say I have a column in Oracle DB like this: SOMETHING_TS TIMESTAMP WITH TIME ZONE And I would like to use CriteriaQuery to filter by this column. I can used native query to achieve this:...
In this code I need the id to be the primary key and also it must be incremented. is getter and setter required for id ? @Entity public class Contact { @Id private Integer id; private String firstNa...
Is there any way to specify SQL comments through JPA annotations? Comments for tables and columns.
I have Hibernate JPA application. I keep getting "java.lang.IllegalArgumentException: No query defined for that name [Singer.findAll]" in the function from DAO class, even though I defined the name in...
I have a MySQL column declared as type JSON and I have problems to map it with JPA/Hibernate. I'm using Spring Boot on back-end. Here is small part of my code: @Entity @Table(name = "some_table_n...
I am using the code below to generate unique IDs for an id field. It was working fine until last week. I deleted some entities using the Hibernate interface and then it started giving a unique constra...
The question is in the title. Below I just described some of my thoughts and findings. When I had a very simple domain model (3 tables without any relations), all my entities did NOT implement the Ser...
I reconfigured my DAOs to a more convenient way (by using JpaRepository) instead of doing all that boilerplate code manually. But now everytime I start the Spring Application it gives me the following...