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

Do update instead of delete/insert for @ElementCollection Map

I have an entity with the following mapping defined: @ElementCollection(fetch=FetchType.LAZY, targetClass=MyEntityTranslations.class) @CollectionTable(name="MY_ENTITY_TRANSLATIONS",…
dnc253
  • 39,967
  • 41
  • 141
  • 157
2
votes
2 answers

JPA EclipseLink: Persisting detached entity does not throw any error

I am learning JPA Entity life cycle and i want to understand the 'Detached' entities. Below is my code, //Creating a new employee with id and name field Employee e = new Employee("1001","Sasi"); em.getTransaction().begin(); em.persist(e); …
JPS
  • 2,730
  • 5
  • 32
  • 54
2
votes
1 answer

change eclipselink log level dynamically

I am using eclipselink with tomcat and I have the logging level to FINE. Please guide me how can I change the log level dynamically without restarting tomcat. I use log4j and is there a way to use log4j config to change eclipselink log levels.
user3733071
  • 31
  • 1
  • 4
2
votes
3 answers

How to use JPA outside of a web project?

I've used eclipselink in a web project in NetBeans. It works nice and easy. How can I do the same in a project unrelated to the web (console application)? In my web application I have: @PersistenceUnit EntityManagerFactory enf; Which instantiates…
Esben Skov Pedersen
  • 4,437
  • 2
  • 32
  • 46
2
votes
1 answer

Generating annotated ( @NamedPLSQLStoredFunctionQuery / @NamedPLSQLStoredProcedureQuery) queries

Environment - JavaSE 6, Oracle 11, WebSphere 7, eclipseLink 2.5.2 / 2.6.0 Use Case In our project we use (call from Java) lot of PL/SQL procedures, and functions. We would like to generate annotated queries like @NamedPLSQLStoredFunctionQuery(name…
Jan Horyna
  • 21
  • 1
2
votes
2 answers

JPA/EclipseLink Returning No Results

I am new to Java and JPA. I am trying to connect to a database and return some results from a table, but when I run the query, I get an empty list as a result even though the table has over 100,000 rows. Here is my persistence.xml:
Ross Peoples
  • 903
  • 2
  • 13
  • 20
2
votes
0 answers

Eclipselink EntityManager returning different instance for same entity

I'm using EclipseLink JPA in a spring mvc application. According to the docs at About Persisting Objects there should be a single instance returned: final Account a1 = entityManager.find(Account.class, 2851L); final Account a2 =…
Wienczny
  • 3,958
  • 4
  • 30
  • 35
2
votes
2 answers

eclipselink metamodel with gradle and groovy

How i can get generate metamodel classes from org.eclipse.persistence.jpa.modelgen.processor in gradle? In maven i use someone like maven-compiler-plugin
devil93saa
  • 21
  • 2
2
votes
1 answer

javax.validation.ConstraintViolationException: Bean Validation constraint(s) violated while executing Automatic Bean Validation on event:'prePersist'

Given two entities Department and Employee forming a unidirectional one-to-many relationship from Department to Employee based on respective tables in the database in question as follows. public class Department implements Serializable { @Id …
Tiny
  • 27,221
  • 105
  • 339
  • 599
2
votes
1 answer

set Oracle Current Timestamp to JPA entity

I Have simple question, I want to set Oracle CURRENT_TIMESTAMP to my JPA entity, I do not want Java to send value. I tried below but did not work. @Column(name="TMSP", columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP", nullable=false) private…
CodeDCode
  • 390
  • 5
  • 17
2
votes
1 answer

JPA EclipseLink Custom Entity/Object as IN Parameter

I have stored procedures working when i pass in basic java objects (String, Long, etc.) but i cant seem to pass in my own Entity/Object without getting the following error: Exception [EclipseLink-4002] (Eclipse Persistence Services -…
Craig
  • 199
  • 1
  • 2
  • 11
2
votes
1 answer

There should be one non-read-only mapping defined for the primary key field

Hi I've the following code (using eclipselink 2.6): Transmission: @Entity public class Transmission { @Column(name="TRANSMISSION_ID") @Id private Long id; @Column(name="TRANSMISSION_CONTENT") private String…
theprogrammer
  • 57
  • 2
  • 7
2
votes
1 answer

RCP Editor and JPA merge

I am updating an RCP based application to use JPA 2.1 (EclipseLink's implementation) from Hibernate 3.x. The JPA merge behavior is causing me problems. The issue I am seeing is when I assign the returned value to the model object in the RCP editor…
Timothy Vogel
  • 1,363
  • 2
  • 21
  • 39
2
votes
0 answers

Querying a root entity in entity inheritance in JPA

I am experimenting the joined table inheritance in JPA (EclipseLink 2.6.0 having JPA 2.1). If I execute the following JPQL statement on the root entity Vehicle, List vehicleList = entityManager.createQuery("SELECT v FROM Vehicle v",…
Tiny
  • 27,221
  • 105
  • 339
  • 599
2
votes
1 answer

EJB failure to update datamodel

Here my EJB @Entity @Table(name = "modelos") @NamedQueries({ @NamedQuery(name = "Modelos.findAll", query = "SELECT m FROM Modelos m"), @NamedQuery(name = "Modelos.findById", query = "SELECT m FROM Modelos m WHERE m.id = :id"), …
Ignacio Garat
  • 1,536
  • 6
  • 24
  • 48