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.

4898 questions
337
votes
19 answers

The JPA hashCode() / equals() dilemma

There have been some discussions here about JPA entities and which hashCode()/equals() implementation should be used for JPA entity classes. Most (if not all) of them depend on Hibernate, but I'd like to discuss them JPA-implementation-neutrally (I…
MRalwasser
  • 14,580
  • 14
  • 95
  • 134
167
votes
7 answers

Please explain about insertable=false and updatable=false in reference to the JPA @Column annotation

If a field is annotated insertable=false, updatable=false, doesn't it mean that you cannot insert value nor change the existing value? Why would you want to do that? @Entity public class Person { @Id @GeneratedValue(strategy =…
Thang Pham
  • 35,825
  • 73
  • 192
  • 279
96
votes
8 answers

Parameter in like clause JPQL

I am trying to write a JPQL query with a like clause: LIKE '%:code%' I would like to have code=4 and find 455 554 646 ... I cannot pass :code = '%value%' namedQuery.setParameter("%" + this.value + "%"); because in another place I need :value not…
Manuele Piastra
78
votes
5 answers

What is referencedColumnName used for in JPA?

In JPA there is an attribute called referencedColumnName that can be set on @JoinColumn, @PrimaryKeyJoinColumn what is the idea behind this setting, can someone give a good example of where this can be used?
ams
  • 52,592
  • 57
  • 169
  • 252
64
votes
11 answers

Why do I need to configure the SQL dialect of a data source?

When we configure a data source using Hibernate, we should add the hibernate.dialect property (or eclipselink.target-database if you are using EclipseLink). I want to know what is the meaning of dialect? I configure this property according to the…
Captain Kidd
  • 1,173
  • 2
  • 11
  • 20
55
votes
8 answers

JPA2: Case-insensitive like matching anywhere

I have been using Hibernate Restrictions in JPA 1.0 ( Hibernate driver ). There is defined Restrictions.ilike("column","keyword", MatchMode.ANYWHERE) which tests if the keyword matching the column anywhere and it is case-insensitive. Now, I am…
Gaim
  • 6,289
  • 4
  • 35
  • 58
48
votes
8 answers

Disable caching in JPA (eclipselink)

I want to use JPA (eclipselink) to get data from my database. The database is changed by a number of other sources and I therefore want to go back to the database for every find I execute. I have read a number of posts on disabling the cache but…
James
  • 3,397
  • 10
  • 45
  • 57
47
votes
10 answers

EclipseLink 2.7.0 and JPA API 2.2.0 - signature mismatch

When running a project built by maven with the following dependencies: org.eclipse.persistence javax.persistence 2.2.0
Stéphane Appercel
  • 1,367
  • 2
  • 12
  • 18
47
votes
5 answers

Entitymanager.flush() VS EntityManager.getTransaction().commit - What should I prefer?

What should I prefer when updating the database? What are the pros & cons with either method and when shall I use the one or the other? public void disemployEmployee(Integer employeeId, Date endDate) { Employee employee =…
Rox
  • 2,397
  • 13
  • 45
  • 78
45
votes
8 answers

JPA Enum ORDINAL vs STRING

It's possible to define enumerations in JPA using either @Enumerated(EnumType.ORDINAL) or @Enumerated(EnumType.STRING) I wonder what are advantages and disadvantages of those two definitions? I heard that ORDINAL performs better (is faster) than…
jst99
  • 469
  • 1
  • 4
  • 4
41
votes
1 answer

JPA: JOIN in JPQL

I thought I know how to use JOIN in JPQL but apparently not. Can anyone help me? select b.fname, b.lname from Users b JOIN Groups c where c.groupName = :groupName This give me Exception org.eclipse.persistence.exceptions.JPQLException Exception…
Thang Pham
  • 35,825
  • 73
  • 192
  • 279
38
votes
5 answers

What is a JPA implementation?

I'm getting started with JPA, and I'm confused as to what exactly the JPA implementation(EclipseLink, TopLink, Hibernate, etc.) does. I understand the theoretical role of JPA, but what is the purpose of the various implementations? Are there…
user262525
  • 627
  • 1
  • 5
  • 7
36
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
  • 8,699
  • 15
  • 45
  • 72
35
votes
3 answers

Is it possible to output generated SQL using EclipseLink without having to increase log verbosity?

I want to output the SQL generated by EclipseLink to the console, during development. However, I could only do so using the logging level FINE. I have a complex domain model composed of many classes, so much that deployment takes a considerable…
javabeats
  • 892
  • 2
  • 10
  • 26
35
votes
4 answers

Is it possible to write a generic enum converter for JPA?

I wanted to write a Converter for JPA that stores any enum as UPPERCASE. Some enums we encounter do not follow yet the convention to use only Uppercase letters so until they are refactored I still store the future value. What I got so far: package…
wemu
  • 7,236
  • 3
  • 30
  • 51
1
2 3
99 100