Questions tagged [eclipselink]

EclipseLink delivers a comprehensive open-source Java persistence solution. EclipseLink focuses on standards (JPA, JAXB, SDO) with advanced features, performance and scalability for enterprise software developers across data sources, formats, and containers.

EclipseLink delivers a comprehensive open-source Java persistence solution. EclipseLink focuses on standards (JPA, JAXB, SDO) with advanced features, performance and scalability for enterprise software developers across data sources, formats, and containers.

5055 questions
38
votes
4 answers

Hibernate or EclipseLink for JPA?

I was wondering if anyone has experience with the JPA2.0 implementation of any of those frameworks? Especially together with Spring3.x which comes with EclipseLink support. Do you use any of those frameworks and JPA2.0 for production? Any severe…
Ta Sas
  • 9,573
  • 15
  • 51
  • 73
38
votes
4 answers

Batch inserts using JPA EntityManager

Is there a way where we can use batch inserts using JPA EntityManager. I know there is no direct way to achieve this but there must be some way to achieve this mechanism. Actually, for every insert operation it's taking me 300ms which I want to…
Prathap
  • 1,023
  • 7
  • 19
  • 33
37
votes
13 answers

How to silently truncate strings while storing them when they are longer than the column length definition?

I have a web app, using EclipseLink and MySQL for storing data. Some of these data are strings, ie varchars in the DB. In the code of entities, the strings have attributes like this: @Column(name = "MODEL", nullable = true, length = 256) private…
Fabien
  • 6,700
  • 7
  • 35
  • 35
35
votes
8 answers

Manually specify the value of a primary key in JPA @GeneratedValue column

I'm having an Entity which has a primary key / id field like the following: @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; This works well. I'm using EclipseLink to create the DDL-Schema, and the column is correctly…
scravy
  • 11,904
  • 14
  • 72
  • 127
33
votes
4 answers

To initialize or not initialize JPA relationship mappings?

In one to many JPA associations is it considered a best practice to initialize relationships to empty collections? For example. @Entity public class Order { @Id private Integer id; // should the line items be initialized with an empty…
ams
  • 60,316
  • 68
  • 200
  • 288
33
votes
7 answers

JPA Inheritance demands ID in subclass

I have a problem with my jpa domain model. I am just trying to play around with simple inheritance for which I use a simple Person base-class and and a Customer subclass. According to the official documentation (both, JPA and EclipseLink) I only…
lostiniceland
  • 3,729
  • 6
  • 38
  • 50
32
votes
4 answers

How to use Postgres JSONB datatype with JPA?

Im not finding a way to map the JSON and JSONB datatypes from PostgreSQL using JPA (EclipseLink). Is some one using this datatypes with JPA and can give me some working examples?
justcode
  • 1,562
  • 3
  • 14
  • 25
31
votes
3 answers

Multiple writable mappings exception in EclipseLink

I have these tables: Which my intention is : A user can be a company or a person but each one of them have something in common, as username which is the email and password, so I used the JPA Tools to generate the entities from the table which…
Valter Silva
  • 16,446
  • 52
  • 137
  • 218
31
votes
8 answers

How to write JPA query with boolean condition

In my project i am using JPA 2.0 with eclipselink inplementation, an I have following problem: I have defined entity with boolean column: @Entity public User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) …
Rado Skrib
  • 396
  • 1
  • 4
  • 7
31
votes
5 answers

Java/JAXB: Unmarshall Xml to specific subclass based on an attribute

Is it possible to use JAXB to unmarshall xml to a specific Java class based on an attribute of the xml?
Frothy
  • 335
  • 1
  • 3
  • 6
29
votes
3 answers

HikariPool-1 - jdbcUrl is required with driverClassName

I went back to programming my old program https://github.com/JonkiPro/REST-Web-Services. I've updated Spring Boot from version 15.6 to version 2.0.0. I have encountered many problems with compilation, but I can not deal with one. Well, during…
rytyrtytr
  • 493
  • 2
  • 5
  • 6
28
votes
4 answers

How to implement a temporal table using JPA?

I would like to know how to implement temporal tables in JPA 2 with EclipseLink. By temporal I mean tables who define validity period. One problem that I'm facing is that referencing tables can no longer have foreign keys constraints to the…
Alfredo Osorio
  • 11,297
  • 12
  • 56
  • 84
28
votes
5 answers

How do I import javax.validation into my Java SE project?

I'm trying to add constraints checking, as described here How to specify the cardinality of a @OneToMany in EclipseLink/JPA
simpatico
  • 10,709
  • 20
  • 81
  • 126
27
votes
6 answers

JPA - Persisting a Unidirectional One to Many relationship fails with EclipseLink

I'm trying to persist a very simple Unidirectional One to Many relationship, but EclipseLink (2.3.1) fails. Service Class (Parent): @Entity @Table(name = "tbl_service2") public class Service implements Serializable { @Id …
gamliela
  • 3,447
  • 1
  • 35
  • 41
26
votes
1 answer

Spring JPA: What is the cost of saveandflush vs save?

I have an application built from a set of microservices. One service receives data, persists it via Spring JPA and Eclipse link and then sends an alert (AMQP) to a second service. Based on specific conditions, the second service then calls a…
skyman
  • 2,255
  • 4
  • 32
  • 55