eclipselink

Eclipse git client with upload-pack support

I tried Egit but there seems to be missing an option for specifying a custom upload-pack binary. Are there any patches or Gui alternatives for this to work ? ...

Is there how I could programmatically ask eclipselink to drop and create all tables?

This helps in unit testing. ...

jndi database connection with jpa and eclipselink

Hi, I try to setup a database connection in java with JNDI in combination with eclipseLink/JPA on Tomcat 5.5. I already configured the JNDI resource in web.xml and context.xml. The db connection works with JNDI without using JPA and eclipseLink. After configuring the persistence.xml for eclipseLink, I got the following exception. I do...

Eclipselink: modifying the deploy.xml and entities using java code

I have built several applications using Eclipselink and the EL Workbench to generate entity files and all necessary configuration as a deploy.xml file. For my next project, I would like to be able to modify the deploy.xml at runtime, using some sort of XML API, and be able to generate the revised entity files and ideally manipulate the ...

Eclipselink is living in the past, DDL not reflecting Entities

Weird stuff... I have happily used EclipseLink / JPA 2 as provider for my persistence unit for a while (with a MySQL RDBMS in the back). I had DDL-drop/create turned off, since I wanted to keep records in the DB and there weren't any changes to the Entities anyway. Now I've just made some bigger changes to one Entity (adding some attrib...

How do I query for only superclass entities in a jpql query?

I have the following entities: @Entity @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name="orderType", discriminatorType=DiscriminatorType.STRING) @DiscriminatorValue(value="BASE") @Table(name = "orders") public class OrderEntity implements Serializable { ... and @Entity @DiscriminatorValue(value="RECURRING...

EclipseLink and database encoding

Hello guys, I am a developer for a global application, which was deployed in a few countries whose languages were not a problem for us. But now, we're going to Slovakia, and we're having a bit of trouble with EclipseLink. We've setup a small web application to test the text encoding on the database for their project. We're able to read...

@Id for oracle.rowid

Howto declare @Entity class for oracle table w/o PK? I has received the error message: Column "rowid" cannot be resolved on table "LOG" when doing mapping like this: @Entity public class Log implements Serializable { ... @Id private ROWID rowid; ... } ...

Please explain about: insertable=false, updatable=false

Please rest assure that I did some search trying to understand about this as much as possible, but most of the community posts are about implementation instead of explanation. I guess I just dont understand it correctly, but if a field is annotated insertable=false, updatable=false, doesnt it mean that you cannot insert value nor change ...

How to stop handled Exceptions from being logged?

I have just implemented exception handling for a unique-constraint of a JPA entity. It is working as I want it to, but when triggered dumps the handled exceptions to the container logfile. A JPA entity is managed by a SLSB (Service Façade). The Service Façade is called from another SLSB, which provides remoting capabilities based on JA...

JPA: how to make a field auto increment

I use Eclipselink as my JPA provider, how can I make a field auto increment? ...

Problem Deploying Wicket/JPA (EclipseLink) App to Glassfish

Hi, I have a small Wicket app that I can deploy to Glassfish v3 without any problems. I also have a JAX-RS webservice that includes a jar file that contains JPA entity beans and stateless service beans that deploys successfully. However, when I try to deploy a different Wicket application that makes use of the same entity/service jar,...

JPA/EclipseLink - Calculated column

Hi, I'm trying to learn JPA. I created a simple entity class. This entity has 3 columns: ID, NAME, NUMBER_A. It's working fine: I can persist, update and delete without problems. What I'm trying to do is to create a calculated/computed column. I want to retrieve NUMBER_A, use it to calculate a new value and set the calculated column (l...

Eclipselink subquery error

The following NamedQuery is giving a parsing error in Eclispelink . please help @NamedQuery(name = "OaaFlexrolesUnitT.findFlexRolesAvailableUsers", query = "select c.netId,a.emplname from IsiEdbBasT a,NyuEdbEmpT b,OaaUserRolesT c where a.emplid=b.emplid and a.emplstat <> 'X' and a.orgid = ' ' and a.qtrno = 0 and a.orgid =...

Mapping column and table names in EclipseLink

I used ImprovedNamingStrategy in hibernate, to mapping Java field name to MySQL column name. ex) birthDate field -> birth_date column, AccountRole class -> account_role table I'm doing test migrating hibernate code to eclipselink code. What is the equivalent in EclipseLink to hibernamte's ImprovedNamingStrategy ? ...

Using EclipseLink MOXy with Java 1.5

Has anyone got EclipseLink MOXy (I'm using eclipselink 2.1.0) to work with Java 5? Whenever I try to unmarshal I get a null pointer exception in org.eclipse.persistence.oxm.record.UnmarshalRecord, in the startCDATA() method (xPathNode is null). The exact same code and XML works wonderfully in Java6. ...

How to set collection items for in-clause in jpql?

Is there a possiblity in JPA 2.0 to set a collection for in-clause in jpql-query? (I'm using EclipseLink) The next example fails: TypedQuery<Person> q = em.createQuery("select p from Person p where p.name in (?1)", Person.class); List<String> names = Arrays.asList(new String[] { "Bill Gates", "Steve Jobs" }); // THIS FAILS q.setParame...

Extract the primary key from a entity object in JPA 2.0?

Let's say we have an entity object. Is there a way to extract a primary key from it? I want to do something like this: public static Object extractPrimaryKey(EntityManager em, Object obj) { return em.giveMeThePrimaryKeyOfThisEntityObject(obj); } Reason for that is to get an attached copy of detached entity: public static Object ...

CollectionAttribute testing in JPA CriteriaBuilder

Hi, I have a CriteriaBuilder and am trying to create a predicate to restrict results in a CollectionAttribute. I would like to say something like get all entities in this collection where the entity's attribute A equals x. For example, I have lots of People entities. They have a collection of job titles (previous and current) and I'd lik...

Why cannot a JPA mapping attribute be a LinkedHashset?

Motivated by this question, I've tried to change the following: @ManyToMany(cascade={CascadeType.REMOVE, CascadeType.MERGE}) private Set<Expression> exps = new LinkedHashSet<Expression>(); to: @ManyToMany(cascade={CascadeType.REMOVE, CascadeType.MERGE}) private LinkedHashSet<Expression> exps = new LinkedHashSet<Expression>(); ...