What is wrong with this JPQL query?

I'm trying to execute the fallowing query on my server Here is my query: List<Object> result = entityManager .createQuery("SELECT post FROM PostMW post LEFT OUTER JOIN LikeMW likes ON post.id = likes.post_id AND likes.user_id =:userID") .s

Class not found when using JAX-RS with Eclipse and Glassfish

I am using Eclipse Luna (versions 4.4.2) and Glassfish 4 to build a REST web-app using JAX-RS. The following piece of code, which is just a very simple post to the REST api that was previously working just fine, has started throw a very strange error

Eclipselink JPA onetomany relation

I am trying to model a simple OneToMany relationship with EclipseLink JPA & MySQL. It fails with some error messages. Can anyone help me to understand what it is missing ? @Entity public class Job implements Serializable { @Id @GeneratedValue private

How does the JPA cache update externally modified entities?

I faced an issue earlier with JPA. I have two apps : the main one, using Java/JPA (EclipseLink), and a second one, using PHP. The two apps have access to the same database. Now, I'm accessing an "Expedition" object through Java, then calling the

How to update the cache after persisting?

I am using JPA (EclipseLink 2.5) for persistence. My web app contains AJAX page updates. When a post is saved, the posted content shows up without refreshing the browser. The post have tags associated with it using a OneToMany relationship. These tag

Generation of Eclipselink 2.5 Metamodel using Maven

I would like to know how to generate static metamodels using Maven and Eclipselink 2.5. It worked fine by adding this lines to pom.xml when running Eclipselink 2.4. // Generate meta model for eclipselink 2.4 (does not work for 2.5) <plugin> <grou

JPA Multiple Databases - Simple Example / Best Model?

I have 2 mySql databases that I'm trying use in a simple Java EE Web Application. To simplify the scenario, the schemas are identical, and for example lets take the Customer table in each. I'm trying to decide on the best way to return "union" r

JPA - @EmbeddedId and @Id

This is the relevant JPA code: @MappedSuperClass public abstract class SuperClass { @EmbeddedId private FileId fileId; protected SuperClass() { } public SuperClass(FileId fileId) { this.fileId = fileId; } } @Embeddable public class FileId { protected

Unable to change column names in JPA Eclipselink

I'm having problems making @Column(name="example") working. I've got a User class: @Entity public class User { @Id private String username; .... } A Role one: @Entity public class Role { @Id private String name; .... } That are in a ManyToMany r

how to disable the cache in eclipselink

I have tried disabling L2 cache in EclipseLink with Eclipse indigo by using following properties in persistence.xml:- <property name="eclipselink.cache.shared.default" value="false"/> <shared-cache-mode>NONE</shared-cach

What collections does jpa return?

Does JPA ( Eclipselink in this case) always return IndirectList where Entity have a List? Is ok that list or It should be converted to another list( maybe linkedlist)?Analysis If we look at EclipseLink's IndirectList's API, it says: To use an Indirec

JPA potential performance issue when polling users

Looking for some feedback on querying for a user when authenticating. The first thought i had when writing the code below was to get the username by querying all usernames in the database and checking if the username provided belongs to a list of use

Where is the EclipseLink / Maven repository? (again)

Yes, I know, the subject was asked before, but the repository moved again. Has anybody seen it? I would be much obliged.A quick search reveals a long list of mirrors, most of them returning 404s but their cache entry is still viewable (for now). So i

Should I leave JPA or the cascading database of deletions?

Let's say we have two entities, A and B. B has a many-to-one relationship to A like follows: @Entity public class A { @OneToMany(mappedBy="a_id") private List<B> children; } @Entity public class B { private String data; } Now, I want to de

EclipseLink Session Customization - Error

In a 3-tier web project using EclipseLink with all business logic on the DB, I need to execute a stored procedure before and after every single stored call, be it procedure or function, in the same session. That's a management decision and I can't do

JPA EclipseLink 2 Query Performance

APPLICATION and ENVIRONMENT Java EE / JSF2.0 / JPA enterprise application, which contains a web and an EJB module. I am generating PDF documents which contains evaluated data queried via JPA. I am using MySQL as database, with MyISAM engine on all ta

Under which conditions would SELECT by PRIMARY KEY be slow?

Chasing down some DB performance issues in a fairly typical EclipseLink/JPA application. I am seeing frequent queries that are taking 25-100ms. These are simple queries, just selecting all columns from a table where its primary key is equal to a valu