openjpaRelated issues-Collection of common programming errors


  • Lord_Herman
    java jpa junit4 hashcode openjpa
    Despite all the controversy with equals/hashCode and JPA I’m dealing with a problem reminds me “What was 1st? The egg or the hen?I’m using JPA for implementing my persistence layer, and JUnit 4 for testin it, the problem is if I override equals and hashCode methods, JUnit test raises an exception I can’t understand. For some time I’ve ignored those 2 method, but if i need to use @Embeded classes I must override them. So, if I ignore those 2 method I can’t use @Embeded classes, and if I use those

  • Sotirios Delimanolis
    java spring jpa openjpa
    This question already has an answer here:Why is my Spring @Autowired field null?1 answerapplicationContext.xml<?xml version=”1.0″ encoding=”UTF-8″?> <beans xmlns=”http://www.springframework.org/schema/beans” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:context=”http://www.springframework.org/schema/context” xmlns:aop=”http://www.springframework.org/schema/aop” xmlns:tx=”http://www.springframework.org/schema/tx” xmlns:p=”http://www.springframework.org/schema/p” xmlns:cache

  • user1595858
    jboss7.x slf4j openjpa openjpa-maven-plugin
    My EAR application runs fine when i don’t use openJpa. Once i use open JPA i get the “SLF4J fail to load class blaaa “. How to configure the openJpa module to use the SL4J which i provide from pom.xml and avoid that error?I use JBOSS 7.1.1pom.xml<properties><slf4j.version>1.7.3</slf4j.version><logback.version>1.0.10</logback.version></properties><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version&

  • Jaime Alvarez
    java jpa websphere openjpa
    I’m new in JPA.I’ve created a JPA Entity (see below). When I try to use it from a java client when I insert one record into the database I have the following exception (see below)Any Ideas to try to skip this eror?The Client:package co.ne.staffmanagement.test;import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence;import co.ne.staffmanagement.domain.Employee;public class TestHarness {

  • seba.wagner
    java serialization jpa red5 openjpa
    My framework seems to have issues with a special entity that constantly fails to get serialized with an exception.Entity: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/basic/Server.java?view=markupMy theory: The serializer uses the enhanced class from OpenJPA, and it cannot serialize it. But I have no idea how this can only happen with this entity and all other work fine.Exception:WARN: Exception: java.lang.reflect.Invocatio

  • Wlad
    java-ee jpa ejb openjpa
    I am trying to create database from annotated EJB entities. Using: Eclipse, Ant tool, Apache Tomee server, OpenJPA, JEE/EJB’s, MySQL db.My app fails during injecting entity manager(that is suppose to trigger db creation following annotated entity classes). Some crucial app parts:Exception i am getting looks like this:prepare-database:[echo] Inserting default user into database.[java] Dec 09, 2013 9:45:29 AM org.apache.openejb.client.EventLogger log[java] INFO: RemoteInitialContextCreated{provide

  • VladS
    java classloader openjpa weblogic-10.x
    it’s difficult to describe case so below short case and result of my investigation:Environment:java 1.6 weblogic-10.3.6.0 openjpa – 1.1.0 spring – 3.2 Two persistence-unit in one persistence.xml (A and R)Case:Deploy war file to weblogic is successful Stop app in admin console Try start app – it’s Failed Try start again – it’s success!stacktraceweblogic.application.ModuleException: :org.apache.openjpa.persistence.ArgumentException:Table “ACTION_COMMENT” given for “……ActionComment”

  • Lukasz ? L ?
    jpql openjpa
    Can I do something like this on JPQL?SELECT NEW com.MyDTO(p.a, p.b, q.c, q.d) FROM (SELECT r.* FROM MyDTO1 r ) p LEFT OUTER JOIN (SELECT s.* FROM MyDTO2 s ) q ON p.x = q.y or similar? (Above query has mixed with native and JPQL, so don’t misunderstand)I’m having a problem with this part I think.FROM (SELECT r.* FROM MyDTO1 r ) pWhen I’m trying to execute I’m getting this error.Exception Description: Syntax error parsing the query […..], unexpected token [(]Thank you!

  • Gnavvy
    hibernate jdbc fetch openjpa toplink
    OpenJPA provided some parameter in the FetchPlan. (http://openjpa.apache.org/builds/1.2.0/apidocs/org/apache/openjpa/persistence/FetchPlan.html) And I was stuck in one of them, the FetchBatchSize. Hope someone can kindly share their experience.Here is the scenario, say I was going select up to 1000 record from the database(MS-SQL) 1. if I left FetchBatchSize to its default value -1, it will take some 20 seconds to return the 1000 records;if I set the FetchBatchSize to 100, the time cost was redu

  • Chris Travers
    java openjpa
    after creating my entities with the OpenJPA’s ReverseMappingTool I recognized that the tool mapped the db-fieldtype “intversion numeric(9,0) NOT NULL” of my postgres-DB to private double intversion; in my java-file. Since there is a zero after the decimal point I just don’t understand why the field is mapped to double and not to int? Change I change that? I want an int or an Integer in my Java-Class without changing the db-structure.The point is, that the files are generated at runtime, so ther

Web site is in building