eclipselink « Eclipse « JPA Q&A





1. Best Practices for Building Where-In Clause in EclipseLink 1.1    stackoverflow.com

I'm on a project using EclipseLink 1.1, and I have a query where the obvious thing for me to do is use a Where-In clause, like so:


     ...

2. How to increase PermGen memory for eclipselink StaticWeaveAntTask    stackoverflow.com

We are using Eclipselink and need to weave the code in order for lazy fetching to work property. During the weave process I'm getting the following error:

weave:  

BUILD FAILED  ...

3. hibernate or eclipselink?    stackoverflow.com

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 ...

4. JPA 2.0 EclipseLink Check for unique    stackoverflow.com

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 ...

5. JPA 2.0 Eclipse Link    stackoverflow.com

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?

6. Using EclipseLink    stackoverflow.com

I am still new to Java and Eclipse and I'm trying to get my application to connect to a database. I think I want to use EclipseLink, but all of the ...

7. JPA/EclipseLink Returning No Results    stackoverflow.com

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 ...

8. Difference Hibernate 3.5 / JPA 2.0    stackoverflow.com

So far, I always prefered to use Hibernate directly rather than JPA 1.0, because JPA was lacking some of the important features I needed and Hibernate provided: Criteria API, second level ...

9. Hibernate or EclipseLink for JPA?    stackoverflow.com

I was wondering if anyone has experience with the JPA2.0 implementation of any of those frameworks? Especially together with Spring3.x which comes with EclipseLink support. Do you use any of those ...





10. JPA - Using insertable/updatable    stackoverflow.com

I am writing a webservice to maintain a database. I am trying to use JPA (EclipseLink) for the entity classes. However, the database uses natural primary keys and therefore ...

11. CriteriaBuilder JPA 2.0 Eclipselink    stackoverflow.com

If I want something like that with EclipseLink and JPA 2.0 SELECT ... FROM ... WHERE name1=value1 AND name2=value2 OR name3=value3 Which is the best way?? In the oficial say somthing like:

cq.where(cb.equal(pet.get(Pet_.name), ...

12. JPA best practice question - Updating one field only    stackoverflow.com

My question is similar to http://stackoverflow.com/questions/3476613/updating-one-field-in-jpa-entity Basically I have an entity Foo which has some basic fields (enum, String, DateTime) and it has two other fields. One of them is a ...

13. jpa find problem    stackoverflow.com

hi the find method does not return the latest version of an object. somewhere in my code I find an object, change it, merge it and commit my changes. In the database the ...

14. Please explain about: insertable=false, updatable=false    stackoverflow.com

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 ...

15. Can I implement if-new-create JPA strategy?    stackoverflow.com

My current persistence.xml table generation strategy is set to create. This guarantees that each new installation of my application will get the tables, but that also means that everytime the application ...

16. Why does eclipselink consume the whole allocationSize each time it's rebooted?    stackoverflow.com

I've just noticed that for my entity's id, eclipselink assigns an id 1 + the previously greated assigned IN THE SAME SESSION (1), as opposed to in the element table (2). ...





17. Hibernate and EclipseLink inconsistent behavioiur    stackoverflow.com

The following (simplified version of our) code passes our JUnit tests under Hibernate, but not under EclipseLink. What is needed to make this work under EclipseLink?

public static void store(EntityManager em, String ...

18. Is there any way to omit a variable from super class?    stackoverflow.com

My application class uses a library that has default two variables in it.

   // A class from framework:

public class SuperClass implements Serializable {

  private long id;
  private ...

19. CacheRetrieveMode.BYPASS of EclipseLink is not useful    stackoverflow.com

Follow my code:

Company cc = em.find(Company.class, clientUser.getCompany().getId());
System.out.println(cc.getCompany_code());

HashMap findProperties = new HashMap();
findProperties.put(QueryHints.CACHE_RETRIEVE_MODE, CacheRetrieveMode.BYPASS);

Company oo = em.find(Company.class, clientUser.getCompany().getId(), findProperties);
System.out.println(oo.getCompany_code());
Just like the example "Used as EntityManager properties". here But, there are nothing different ...

20. What is a JPA implementation?    stackoverflow.com

I'm getting started with JPA, and I'm confused as to what exactly the JPA implementation(EclipseLink, TopLink, Hibernate, etc.) does. I understand the theoretical role of JPA, but what is the ...

21. Cannot get DBUnit to import data for CollectionTable    stackoverflow.com

I have the following Entity:

    @Entity
    @Table
    @NamedQuery(name = Constants.FINDALLFINDERNAME,
             ...

22. Sorting dynamic localized data    stackoverflow.com

I've been working on a Java EE 6 project (EJB 3.1, JSF 2, JPA 2) for some time now and I cannot figure out a good way to sort dynamic localized ...

23. Eclipselink and ArrayMapping JPA problem    stackoverflow.com

I have problem extracting data of the Oracle custom type from the database.
One of the columns in the table is of the Oracle custom type (which is actually VARRAY): Here is create ...

24. Eclipselink: ObjectArrayMapping and ClassDescriptor    stackoverflow.com

I try to create ObjectArrayMapping using DescriptorCustomizer:

public class MyDescriptorCustomizer implements DescriptorCustomizer {
public void customize(ClassDescriptor descriptor) throws Exception {
...

25. Eclipselink: Custom implementation for CRUD operations    stackoverflow.com

Is it possible to provide a custom java methods for the basic CRUD operations using Eclipselink? So, i want java method InsertObjectA to run whenever em.persist is called on ObjectA and ...

26. JPA - don't want to hard code unitName in @PersistenceContext    stackoverflow.com

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 ...

27. How to use EclipseJPA with iReport    stackoverflow.com

I am working on a Swing based database application. I have already setup my model using EclipseJPA. I have also created a controller class that talks to the model layer when ...

28. Java JPA class converters    stackoverflow.com

I'm using EclipseLink in Glassfish with my JavaEE application and have some java.util.Locale-columns in my model classes which I would like to store as String-columns in my database tables. I know Hibernate ...

29. How to config depth of cascade operation in EclipseLink?    stackoverflow.com

For example, there is a relationship between A , B and C: A has Many B, B has many C. I want to remove B and C while remove A. Default is, When remove ...

30. How to get unique results in JPA    stackoverflow.com

I am using this JPA-Query (EclipseLink):

SELECT e FROM Entity e GROUP BY e.label
But i get all rows in my result instead of only the unique labels. My second approach was using DISTINCT ...

31. Static Weaving for EclipseLink with Eclipse WTP    stackoverflow.com

I've got a project running on Tomcat within Eclipse WTP that deploys with some JPA entities. I would like to enable ChangeTracking on these entities, but this requires enabling weaving. Since ...

32. CriteriaQuery "where" gets lost when "orderBy" is applied    stackoverflow.com

I am learning how to use CriteriaQuery in JPA 2.0 and hit a snag. My application builds a query with interactive input from the user. When the column ...

33. jpa on a Desktop SWING Application    stackoverflow.com

I'm developping a mono user desktop application using SWING. I had a little experience with this kind of application on which i used the java.sql api and figured out that it ...

34. Cascade insert with JPA/Hibernate (EclipseLink)    stackoverflow.com

I have two tables like this

|      PERSON       |     |    EMPLOYEE    ...

35. Does Eclipse Link work together with Vertica    stackoverflow.com

i'm currently testing vertica. Since vertica has a jdbc driver it should be possible to get it working. Is there a simple way to get Eclipse link to support vertica? Are there alternative ...

36. CASCADETYPE in EclipseLink JPA    stackoverflow.com

I have two classess. The first class is TNota.

@Entity
@Table(name = "t_nota")
public class TNota implements Serializable {    
@Id
@SequenceGenerator(name="seq_t_nota", sequenceName="seq_t_nota", initialValue=37,   allocationSize=1)
@GeneratedValue(generator="seq_t_nota")
@Basic(optional = false)
@Column(name = "id_nota", ...

37. JPA reads but doesn't persists    stackoverflow.com

My Java Web App reads data from database but when I try to write something, JPA says ok, but the database does not change. I call "merge" method and the data ...

38. Eclipselink characterEncoding equivalence    stackoverflow.com

I have a problem with in JPA - EclipseLink characterEncoding problem. My project's persistent.xml is ;

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="jpa-1" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 ...

39. Getting old data with JPA    stackoverflow.com

I'm getting old data with JPA, even if I disable the cache. I guess is because the resource is configured to be RESOURCE_LOCAL, but I'm not sure.

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" ...

40. EclipseLink 1.2 and BatchFetch    stackoverflow.com

I have run into a EclipseLink issue with multiple queries running against the DB instead of a single query. I found the below SO threads which provides @BatchFetch annotation solution to ...

41. PersistenceUnitLoadingException from EclipseLink    stackoverflow.com

i have already developed a jpa example but it is fine but i am getting the error when running another example with jpa ...

42. EclipseLink versus Hibernate 3.x    coderanch.com

hi there, does anyone know how Eclipselink 1.0 compares to Hibernate 3.x ? I've worked on hibernate 2.x and hibernate 3.x. Long ago I worked on toplink and now, I'm wondering where HIbernate 3.x compares to Eclipselink ? Does eclipselink have the mapping GUI tool ? What are the advantages of eclipselink versus hibernate 3.x ? performance for most common use ...

43. Simple JPA Program using Eclipselink 1.1 in Eclipse    coderanch.com

users.java package test; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.NamedQuery; @Entity @NamedQuery(name="GetUser", query="Select u from users where u.email='abhi'" ) public class users { @Id protected String email; private String password; private Double cash; public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password ...

44. eclipseLink vs hibernate    coderanch.com

Does anyone knows why hibernate needs Serializable for composite-id? "composite-id must implement Serializable" EclipseLink does not need it when running on the same vm. Does anyone knows why hibernate needs to overwrite equals/hashCode for compositeId? EclipseLink does not need it when running on the same vm. Should I go for EclipseLink in future?

45. Problem migrating from Eclipselink    forum.hibernate.org

I'm trying to replace Eclispelink with Hibernate as my JPA provider, however I am unable to deploy my application, I get the following Exception: Code: java.lang.ClassCastException: org.hibernate.mapping.JoinedSubclass cannot be cast to org.hibernate.mapping.RootClass at org.hibernate.cfg.annotations.PropertyBinder.bind(PropertyBinder.java:209) at org.hibernate.cfg.annotations.PropertyBinder.makePropertyValueAndBind(PropertyBinder.java:200) at ...

46. Changing to Hibernate from Eclipselink    forum.hibernate.org