Questions tagged jpa

Explore the latest questions and answers asked by our top developers.

How can I pass an object to an Angular form?

I have a Spring entity, Agent, which contains an Agency. When adding a new agent I have to also pass the agency he works at, but as an object. The backend code works just fine, but when I try to add an agent using an Angular form, I haven’t managed to find how to pass […]

By Alessia
Categorized as angular, forms, jpa, spring, typescript Tagged , , , ,

JPA – Modify object with Id

I have a DB containing objects, and I want to create/modify the object with id 0 Here is my jpa backend MyObjectResource to do this @PutMapping("/myobject") public ResponseEntity<MyObject> updateOrder(@Valid @RequestBody MyObject myobject) throws URISyntaxException { if (!orderRepository.existsById(0l)) { log.debug("Object 0 doesn’t exist"); MyObject result =; return ResponseEntity .created(new URI("/api/myobject/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, […]

By Foxhunt
Categorized as angular, java, jpa, mongodb Tagged , , ,

How to get on my web application and in one click, tickets in XML format directly from Jira

To be able to retrieve, with Jira, all the tickets, for a given interval, I have to extract them manually. That is to say that I click on the button extract in XML form. Then on my web application I retrieve this XML file and put it in the database. However, I would like to […]

Categorized as angular, java, jira, jpa, xml Tagged , , , ,

Angular 5 : rest api is not working with httpclient

I am making a rest API using spring which can do crud operation by following a tutorial. But the HTTP client is not fetching data, on inspecting I got the error GET sockjs.js:1606 GET http://localhost:9000/sockjs-node/info?t=1626851020608 net::ERR_CONNECTION_REFUSED I know my server is running and the link is correct. I have provided Access-Control-Allow-Origin origin in header, if […]

How to build a multi map dropdown Java

How to build a dynamic map by loading data from DB like below, I have been trying couple of options, but no luck. I just need a way to load data into a map, that I can pass it to front-end. "map-data":{ "CLIENT-L1":{ "PERSON-IDS-L2": { "NATIONAL-IDS-l3":["National-ID", "National Driver Licence"], "FOREIGN _IDS-l3":["PASSPORT", "FOREIGN DRIVER LICENSE"] }, […]

By Mahesh kumar
Categorized as angular, hibernate, java, jpa, spring-boot Tagged , , , ,

Http request fetch UTC+0 date instead of UTC+x stored in database

I have a entity with a Date property from package java.util. I store the entity in MySql with JPA. Java entity: @Entity public class Foo { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private Date date; } Storing entity method: @PostMapping("/foo") public Foo create(@RequestBody Foo foo) { foo.setDate(new Date()); return; } The request returns […]

By David Riscanevo
Categorized as angular, http, java, jpa, mysql Tagged , , , ,

Cannot get ressource from java spring api, probably jpa malfunction

My application is an Angular web app getting ressource from a java api with hibernate and jpa. I am going to paste relevant code in order of execution, and then the error (even if the error is not explicit). Angular service calling back-end : const API_URL = ‘http://localhost:8080/communication/’; public getBugReports(): Observable<any> { return this.http.get(API_URL + […]

By A G
Categorized as angular, api, java, jpa, spring Tagged , , , ,

JPA Spring Boot Hibernate Rest API: Why does Hibernate delete before when insert into?

The following scenario I would like to describe: I use Spring Boot as a backend, a MySQL database and Angular 9 as frontend. It is a ManyToMany relationship between employees and booking. MySQL employees: emp_id name 1 test booking: book_id attribute 1 test book_emp: emp_id book_id 1 1 Everything works fine so far but when […]

By Tomas Martincevic
Categorized as angular, hibernate, jpa, rest, spring-boot Tagged , , , ,

How to do pagination in Angular?

I’m getting the data from the back-end using the getUsers API, and then displaying the values using mat table. I’m trying to add the paginator only for the front-end but this does not work. Do I need to add a paginator logic in the allUsers API as well? Please help me edit my code below […]

By Rizana Fazily
Categorized as angular, html, jpa, mat-table, pagination Tagged , , , ,

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us