eclipselink

EclipseLink generates cartesian plan instead of (inner) joins in SQL. Why?

Hello again, In the projects where Hibernate is my persistence provider, I can issue queries with 'join fetch' expressions, and Hibernate will generate SQL that mirrors that: SQL containing join expressions using valid paths of comparison. EclipseLink, however, issues SQL with ugly cartesian plans, that hurt performance quite badly. Wh...

Removing associated entity JPA (or delete orphan equivalent in EclipseLink)

Hi I have a question regarding JPA persistence in Glassfish. Situation: I have a Supplier class that has a 1:n bidirectional relation to SupplierAddress. I would like to have the following behaviour: If I remove the SupplierAddress object from the List in the Supplier object and update it via the merge(supplierobject), the SupplierAdd...

JPA association table is not deletable

Hi I have a problem with JPA (EclipseLink). I am not able to delete a association table. This is the situation: Product 1:n to ProductResource Resource 1:n to ProductResource I first set the product and resource attributes of ProductResource. If I then try to delete the ProductResource object nothing happens (no sql is generated -...

Is there any advantage for using a library other than Hibernate for JPA?

Hi, I've been using JPA for some time now and been in projects where we've used both Hibernate Annotations and Toplink Essentials. AFAIK the project leader chose Toplink because Netbeans had it integrated and seemed to be the easy thing to do. However when looking for help, most of the literature seemed to assume that you are using Hi...

Extending an entity

I have class named AbstractEntity, which is annotated with @MappedSuperclass. Then I have a class named User (@Entity) which extends AbstractEntity. Both of these exist in a package named foo.bar.framework. When I use these two classes, everything works just fine. But now I've imported a jar containing these files to another project. I'd...

Eclipselink factory.createEntityManager() stalls with more than one instance running

Hi, with my RCP program I have the problem that I want to have more than one copy running on my PC. The first instance runs very good. If I start the second instance, everything is fine until I want to access the database. Using this code: .. Map properties = new HashMap(); properties.put("javax.persistence.jdbc.driver...

Integrating GWT, Spring and JPA (Eclipse-link) in Weblogic 10

Hi, My application architecture looks like this. GWT in the UI layer -> Calls GWT RPC service (servlets) -> Looksup Spring Beans -> Calls the DAO layer which is implemented in JPA (EclipseLink). I have successfully tested the application with GWT rpc services directly calling the JPA layer. But I am having trouble integrating spring ...

Eclipselink read complex object model in an ordered way

Hi, I need to read a complex model in an ordered way with eclipselink. The order is mandantory because it is a huge database and I want to have an output of a small portion of the database in a jface tableview. Trying to reorder it in the loading/quering thread takes too long and ordering it in the LabelProvider blocks the UI thread too...

hibernate or eclipselink?

It seems like EclipseLink has been chosen by sun as the reference implementation of JPA 2.0, nevertheless I see lots of people continue to use hibernate... I have no experience with any of them, so I wonder which one should I choose for a new project... I'd like to know the pros / cons of each one... thanks a lot ps: btw, and this is...

Eclipselink: Create objects from JOIN query

Hi, I have a SQL query SELECT * FROM Thing AS a JOIN Thing_Property AS b ON a.id=b.Thing_ID JOIN Property AS c ON b.properties_ID = c.id JOIN Item AS d ON c.item_ID = d.id ORDER BY a.name, d.name and I Eclipselink to create my object model with it. Here is the model: @SuppressWarnings("serial") @Entity public class Thi...

How to export EclipseLink objects to XML

Hi, is there an easy approach to store my model, which I use with EclipseLink, in XML files? I want to implement an export functionality in my program and I was wondering if this can be done with eclipselink or with any other framework. Thanks ...

Brainstorming: Weird JPA problem, possibly classpath or jar versioning problem???

I'm seeing a weird error message and am looking for some ideas as to what the problem could be. I'm sort of new to using the JPA. I have an application where I'm using Spring's Entity Manager Factory (LocalContainerEntityManagerFactoryBean), EclipseLink as my ORM provider, connected to a MySQL DB and built with Maven. I'm not sure i...

Foreign Key constraint violation when persisting a many-to-one class

I'm getting an error when trying to persist a many to one entity: Internal Exception: org.postgresql.util.PSQLException: ERROR: insert or update on table "concept" violates foreign key constraint "concept_concept_class_fk" Detail: Key (concept_class_id)=(Concept) is not present in table "concept_class". Error Code: 0 Call: IN...

Eclipselink and update trigger on multiple access to the database

Hi, in my project I have a database which many clients connect to. Concurrent access and writing works well. The problem now is not to reload the data every second from the database to always have the current status of the data. Does Eclipselink provide a trigger mechanism on (automatically?) reload the data if the database is changed?...

JPA 2.0 EclipseLink Check for unique

Hello... I have a collumn as unique=true.. in Exam class.... I found that because transactions are commited automaticaly so to force the commit i use em.commit() However i would like to know how to check if it is unique.Running a query isnt a solution because it may be an instert after checking because of the concurency.... Which is ...

How to specify the cardinality of a @OneToMany in EclipseLink/JPA

I'm trying to impose a @Oneto7 association. I'd have imagined an attribute that specifies the target many value, but have found none. If there is no such attribute, how else, in JPA/EclipseLink would one achieve it? ...

How do I import javax.validation into my Java SE project?

I'm trying to add constraints checking, as described here http://stackoverflow.com/questions/2705759/how-to-specify-the-cardinality-of-a-onetomany-in-eclipselink-jpa ...

Exception in inserting data into data using JPA in netbeans

SEVERE: Local Exception Stack: Exception [EclipseLink-7092] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.ValidationException Exception Description: Cannot add a query whose types conflict with an existing query. Query To Be Added: [ReadAllQuery(name="Voter.findAll" referenceClass=Voter jpql="...

Execute sql script after jpa/EclipseLink created tables?

Hello, is there a possibility to execute an sql script, after EclipseLink generated the ddl? In other words, is it possible that the EclipseLink property "eclipselink.ddl-generation" with "drop-and-create-tables" is used and EclipseLink executes another sql-file (to insert some data into some tables just created) after creating the ta...

JPA 2.0 Eclipse Link

I have this code @Column(updatable=false) @Enumerated(EnumType.STRING) private ExamType examType; However, I can still change the value when I update it via merge. Why? ...