Click here to Skip to main content
15,886,026 members
Everything / JPA

JPA

JPA

Great Reads

by Han Bo Sun
Detailed description of how many-to-many association works with Hibernate, using MySQL and Spring
by Keyhole Software
In Part 1 of this series, I discussed the basics of loading data from an XML file into a database using JAXB and JPA. (If JSON is called for instead of XML, then the same idea should translate to a tool like Jackson.) The approach is to use shared domain objects – i.e. a single […]
by Sam B. Brown
Interference open cluster is a simple Java framework that enables you to run a distributed database service within your Java application

Latest Articles

by Sam B. Brown
Interference open cluster is a simple Java framework that enables you to run a distributed database service within your Java application
by Han Bo Sun
Detailed description of how many-to-many association works with Hibernate, using MySQL and Spring
by Keyhole Software
In Part 1 of this series, I discussed the basics of loading data from an XML file into a database using JAXB and JPA. (If JSON is called for instead of XML, then the same idea should translate to a tool like Jackson.) The approach is to use shared domain objects – i.e. a single […]

All Articles

Sort by Score

JPA 

4 Jan 2016 by Han Bo Sun
Detailed description of how many-to-many association works with Hibernate, using MySQL and Spring
26 Aug 2014 by Keyhole Software
In Part 1 of this series, I discussed the basics of loading data from an XML file into a database using JAXB and JPA. (If JSON is called for instead of XML, then the same idea should translate to a tool like Jackson.) The approach is to use shared domain objects – i.e. a single […]
7 Oct 2021 by Sam B. Brown
Interference open cluster is a simple Java framework that enables you to run a distributed database service within your Java application
7 Dec 2021 by Afzaal Ahmad Zeeshan
Quote: create relationships between entities in a project that is being written from scratch, or specify what relationships to have between them? That's the best part about an ORM. You don't need to think about it yourself (apart from some index,...
14 Jul 2023 by Andre Oosthuizen
There are a few issues you can check that might cause a no return on your date request. I have added comments in your code where you can check. I have also added the 'System.out.println' to debug all returned parameters in your controller, check...
19 Mar 2024 by Pete O'Hanlon
The beauty of annotation processing is that it doesn't require you to explicitly pick a type in the @SupportedAnnotationTypes. Change that line to @SupportedAnnotationTypes("*") and this should pick up any annotations that you have in the project.
7 May 2014 by salah_abughalyon
I am working on playframework and I have problem with scala forms when i apply the .get() methode to the form to create object i got all the object attributes are null.here is my code:import play.data.*;import static play.data.Form.*;public static Result save() {Form...
10 Aug 2014 by Vishal Jain @ TurtleTec Inc.
/** * Description of bankbranchcontactdetailsBean * * @author Vishal Jain */package com.beans;import javax.persistence.Entity;import javax.persistence.Table;import javax.persistence.TableGenerator;import javax.persistence.Id;import javax.persistence.Column;import...
12 Aug 2014 by Vishal Jain @ TurtleTec Inc.
Please try implementing Serializable interface for your entity (although this is not imposed by Hibernate). Also rename _BankBranchContactId to id. And enable hibernate_sql logging to see the sql query fired.This is what is suggested to me and it worked. No Error or so.But Still Table not...
12 Aug 2014 by Vishal Jain @ TurtleTec Inc.
/** * Description of bankbranchcontactdetailsBean * * @author Vishal Jain */package com.beans;import javax.persistence.Entity;import javax.persistence.Table;import javax.persistence.TableGenerator;import javax.persistence.Id;import javax.persistence.Column;import...
4 Mar 2015 by Sairam39
I recently established load balancing using apache 2.4 +mod_jk 1.2.37 +tomcat 6 environment.Everything working perfectly but I am having a scenario where a unique sequential no has to generate based on some conditions.But after deploying the application in all 3 (clusters) tomcats, my...
24 Nov 2019 by Member 12310790
I am trying to sort capped collection in descending order. what I have tried: @Query(sort = "{$natural:-1}") Flux findAllByConversationId(String conversationId); it gives: Query failed with error code 2 and error message cannot use tailable option with a sort other than...
4 Jan 2020 by Member 14707219
I have a Q&A section where each question and answer has a user profile card associated with it. Which displays username, points etc. Data that makes up this user profile card is spread across multiple tables. I am fetching one or two columns from each of these tables. Now I am not sure what...
4 Jan 2020 by Christian Graus
The id of the user should go against the question or answer, that seems obvious. If you need data across many tables to display this, create views
15 Sep 2020 by Kasthuri Gunabalasingam
I have a table in DB as below.It accessing through JAVA(JPA) I have a table in DB as below.It accessing through JAVA(JPA) ID | Name | Parent_id 1 | Ann | NULL 2 | Mary | 1 3 | John | 2 4 | Joshep| 2 5 | Peter | NULL 6 |...
15 Sep 2020 by Gerry Schmitz
This is what MS says about it: Quote: This executeUpdate method is specified by the executeUpdate method in the java.sql.Statement interface. If executing a stored procedure results in an update count that is greater than one, or that generates...
18 Feb 2021 by Swapnil722
I'm selecting max id of Dosage entity after join Farmers entity: cq.select(cb.max(root.get("id"))) .where(cb.equal(root.join("farmers").get("id"), id)); It doesn't return uniqueResult(); but all Farmers instead. What I have tried: ...
1 Aug 2021 by Andre Ridho
I am trying to learn SpringBoot and Thymeleaf and I am getting a PropertyReferenceException. Most of the answers online have to do with naming errors, yet I have no naming errors; everything is in perfect camel case. Any ideas? Relevant Code: ...
27 Jul 2021 by Richard MacCutchan
See Java persistence API - Tutorial[^]
1 Aug 2021 by Member 15309186
change your model class to look like this @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) @Column(name = "name_of_table_column", unique = true) String id;
7 Dec 2021 by Member 15435322
I was wondering, what is the best way to create relationships between entities in a project that is being written from scratch, or specify what relationships to have between them? For example, as we can directly understand the relationship...
30 Jan 2022 by salam_verdim_alana_panyatkasi_olana
I have to Entity and relationship type between them ManyToMany. @SuppressWarnings("JpaDataSourceORMInspection") @Data @Entity public class Student { @Id private Long id; private Integer anotherId; @ToString.Exclude ...
13 Apr 2022 by osemdeveloper
I have started to learn spring-boot framework with JPA and CRUD repositories . Also, I have completed a project using JPA where it is so easy to do crud operations . But, This is making me to miss how to write custom queries and understand the...
13 Apr 2022 by Richard MacCutchan
Take a look at Lesson: JDBC Introduction (The Java™ Tutorials > JDBC Database Access)[^].
25 Oct 2022 by Mohit Tomar
I'm new to Spring Boot and still learning concepts such as JPA and Hibernate. I was practicing CRUD operations and got an error that totally confused me. I have a project with 4 entities, Admin, Customer, Product, and Saleorder. There is an one...
25 Oct 2022 by Richard MacCutchan
I would suggest going to https://www.baeldung.com/learn-jpa-hibernate[^] for some good learning resources.
19 Aug 2023 by jaikrishna310
I am trying to make a project in spring-boot! But in the controller, I am getting an error in the save() method as follows: The method save(S) in the type CrudRepository is not applicable for the arguments...
18 Mar 2023 by Swapnil722
I want to select all distinct records not a specific one and as entities. I'm using Hibernate 5.6.15, JPA 2.2 and JDK 11 LTS I tried to select transid as an Orders' entity but getting: Caused by: java.lang.ClassCastException: class...
13 Jan 2024 by Swapnil722
Here's the answer : public List custOrder() { try ( Session session = HibernateUtil.getSessionFactory().openSession()) { CriteriaBuilder cb = session.getCriteriaBuilder(); CriteriaQuery cq =...
15 Mar 2024 by Tyler Bakeman
Personal Project: I am new to Maven and have spent a few weeks troubleshooting pom errors with chatGPT. Tutorials are hard to come by online, because annotation-processing in Java is more complicated than the sources I've found. Issue in summary:...
28 Apr 2016 by Prakhar Shrivastava
i found exception while creating a named query.its say NamedQuery:odcall.incoming not found. odcall.incoming is my entity name.What I have tried:@NamedQuery(name="odcalls.call", query="SELECT C.count(id)," + "C.date(CalllocalTime)," ...
28 Mar 2018 by Asyraf Patt
How should i store the data into the object and calling it by using the hashmap ? means is : how should i get the data JPA extraction and call it at mymethod class ? ListCustomer.put(Long.valueOf(1), new Customer("","","","")); What I have tried: SelectCustomer private int...
27 Jul 2021 by User 15041314
I'm new to JPA and generally understand what ORM technologies do. I'm having a serious problem, I want to understand the use of JPA from beginning to end in a comfortable way, instead of memorizing it. So, can you explain what was done here in...
14 Jul 2023 by Thang Đai
I am writing a search function from date to date. But when I click search it doesn't return any results and it doesn't give me any error. file handover.html
17 Aug 2023 by Muhammad Anas 2023
The issue is with spring-data-jpa version, try changing to another version in pom.xml(if its maven) or you may use the below mentioned version if it works for your spring boot project version: ...