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
2
votes
1 answer

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Enum

I get this error while trying to persist an entity 'UserAccount' into the database table. @Entity @Table(name = "user_account") public class UserAccount extends BaseEntity { @OneToMany(cascade = CascadeType.ALL) @JoinColumn(name =…
Vijay Kumar
  • 186
  • 1
  • 9
2
votes
2 answers

How do I prevent EclipseLink (JPA 2.0) from clearing my database/table?

I'm using EclipseLink (JPA 2.0) on Netbeans 7.0 with a MySQL database - which I configured according to this screencast. But sometimes when I persist an Object/Entity my table get's cleared before that object persists, and I get a table with only…
pedrosanta
  • 244
  • 1
  • 8
  • 14
2
votes
1 answer

EclipseLink: multi-column, one-to-one, JPA 2.0 @EmbeddedId using @MapsId fails with read-only on @JoinColumn (derived identities compared)

I have the following design: (source: kawoolutions.com) Simple logic: Foos uses a multi-column PK to PostAddresses using the same columns (same key). Here are the JPA 2.0 @EmbeddedId mappings (using a nested ID class PostAddressId in FooId and the…
Kawu
  • 13,647
  • 34
  • 123
  • 195
2
votes
1 answer

EclipseLink throws JPQLException on using SELECT ... AS in a constructor expression

I have a JPQL query with a constructor expression using EclipseLink 2.7.5. It fails with: Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.7.5.v20191016-ea124dd158): org.eclipse.persistence.exceptions.JPQLException Exception…
Kawu
  • 13,647
  • 34
  • 123
  • 195
2
votes
1 answer

Stored procedures doesn't execute when stopping Java

I created a stored procedure in MySQL and called it from a Java application with JPA EclipseLink. Once the procedure is called, it has a "sleep(sec)" method inside, and then it executes something successfully unless the application is turned off, it…
Gicu Mironica
  • 585
  • 8
  • 22
2
votes
1 answer

Spring Boot between 2.0.9 and 2.1.0 Issue with eclipselink ddl auto generate

Created new project with Spring boot 2.1.0 RELEASE and my pom.xml contains this .. org.springframework.boot spring-boot-starter-data-jpa
privatejava
  • 703
  • 1
  • 9
  • 20
2
votes
1 answer
2
votes
3 answers

GWT RCP - SerializationException

Started a new project from scratch, converted to JPA, my persistence provider is EclipseLink, added the necessary libraries (eclipselink.jar, eclipselink.jar, javax.persistence, mysql-connector-java-5.1). Tested the connection, ping ok. Then created…
Martinho
  • 379
  • 1
  • 3
  • 14
2
votes
0 answers

JPA Entity relationship of 4 tables having 4 join tables

We have an existing old java application using a native sql queries with JDBC. I need to replace the dao layer using JPA + eclipselink. I have generated the entities using eclipse, but I don't know if the generated entities are optimized for one…
2
votes
1 answer

Exchange Entity Table mapping at Runtime with Eclipselink

Is it possible to change the entity-table mapping at runtime with Eclipselink? I have a Entity-View mapping defined with annotations. Now I have the business requirement: "If these Views are empty, try the underlying table". Thus I have to switch…
Soccertrash
  • 1,830
  • 3
  • 28
  • 48
2
votes
0 answers

EclipseLink Nullpointer while executing deffered events(AbstractSession.executeDeferredEvents) with lazy loading

I am getting a NullPointer from EclipseLink during Lazy loading of Children. This is not happening always, but it happens once in a while and once it gets into this exception, it keeps throwing the same NullPointer then on. My Entity Structure…
2
votes
2 answers

JPA providers: why do relationships/FKs to non-PK columns work in Hibernate and EclipseLink?

I just found out that officially relationships/foreign keys to non-primary key columns aren't supported by JPA. See here: Does the JPA specification allow references to non-primary key columns? Why do such relationships map in Hibernate and…
Kawu
  • 13,647
  • 34
  • 123
  • 195
2
votes
1 answer

Criteria API read data in chunks with NOT IN statement

I am using EclipseLink 2.6.4, Java 8 and DB2 for database. I have to write query to read data with NOT IN statement providing a large set of values for NOT IN statement. Basically I have set of external IDs with over 10000 values: Set
carpics
  • 2,272
  • 4
  • 28
  • 56
2
votes
1 answer

NoUniqueBeanDefinitionException when using multiple transaction managers in Spring Integration

Am using Spring Integration XML configuration for polling some database tables and then doing some processing. Everything was working fine, until we introduced multiple data sources. After that we are getting intermittent…
Khushbu
  • 295
  • 4
  • 14
2
votes
1 answer

JPA - don't want to hard code unitName in @PersistenceContext

I am using eclipselink and I have something like this: @PersistenceContext(unitName = "unit1") private EntityManager em; Is there any way that I can specify/read the persistent unit name from a config/property file so that if I want, i can…
neo
  • 2,461
  • 9
  • 42
  • 67