openjpa

org.apache.openjpa.persistence.PersistenceException: null

最后都变了- 提交于 2019-12-13 11:01:38
问题 The second line is causing the exception listed below. This code actually works on the test server, but is blowing up on my box. Can anyone offer a clue what I need to look at to solve this? TypedQuery<ed> _TypedQuery = _EntityManager.createQuery(_CriteriaQuery); List<ed> _edList = _TypedQuery.getResultList(); Exception org.apache.openjpa.persistence.PersistenceException: null at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1017) ~[openjpa-2.2.0.jar:2.2.0] at org.apache.openjpa

table partitioning with jpa throws OptimisticLockException

99封情书 提交于 2019-12-13 07:20:09
问题 I have a log_table in my db that is partitioned according to partitioning docs. I have a function that inserts records to partition table depending on date and a trigger that calls that function, like in the documentation. Trigger example CREATE TRIGGER insert_measurement_trigger BEFORE INSERT ON measurement FOR EACH ROW EXECUTE PROCEDURE measurement_insert_trigger(); Function example CREATE OR REPLACE FUNCTION measurement_insert_trigger() RETURNS TRIGGER AS $$ BEGIN IF ( NEW.logdate >= DATE

Failed to query by spring-data-jpa query methods with suffix IN due to the cachedCriteriaQuery is not correct on openjpa 2.4.1

◇◆丶佛笑我妖孽 提交于 2019-12-13 02:06:21
问题 Update: After I digged into the source code of spring-data-jpa repository query methods, I found the root cause is the createQuery method of PartTreeJpaQuery as below. This method will be called by the invoke method of the QueryExecutorMethodInterceptor of the RepositoryFactorySupport when you call the spring-data-jpa repository query methods interface. public Query createQuery(Object[] values) { CriteriaQuery<?> criteriaQuery = cachedCriteriaQuery; List<ParameterMetadata<?>> expressions =

How to force OpenJPA (1.2.2) to eager load a @ManyToOne combined primary key?

一曲冷凌霜 提交于 2019-12-12 20:24:26
问题 i've got two Entities with combinded primarky keys: @Entity @IdClass(APK.class) public class A { @Id Integer pk1; @Id Integer pk2; @OneToMany(cascade = CascadeType.ALL, fetch=FetchType.EAGER,mappedBy="a") List<B> b = new ArrayList<B>(); String name; ... } @Entity @IdClass(BPK.class) public class B { @ManyToOne(fetch = FetchType.EAGER) @JoinColumns({ @JoinColumn(name = "pk1", referencedColumnName = "pk1"), @JoinColumn(name = "pk2", referencedColumnName = "pk2") }) @Id private A a; @Id Integer

Does JPA support a @OneToMany mapping between entities without a foreign key constraint in the database?

我是研究僧i 提交于 2019-12-12 13:22:25
问题 This is for a legacy database. The two database tables in this relationship don't have a foreign key constraint even though the child table column holds the PK of the parent table. Does JPA support a @OneToMany mapping (either bidirectional or unidirectional) if the child table does not have a foreign key constraint on the appropriate column? 回答1: Short answer: yes . Long one: does JPA actually care about foreign keys if the database already exists? If we leave the task of creating the

OpenJPA and Spring-boot configuration

喜你入骨 提交于 2019-12-12 12:16:01
问题 Im struggling with basic configuration of spring-boot app, with OpenJPA as jpa implementation. Basically I always end up with: Caused by: org.apache.openjpa.util.MetaDataException: The type "class com.openjpa.example.Customer" has not been enhanced. My configuration looks like below: package com.openjpa.example; @SpringBootApplication public class Application extends JpaBaseConfiguration { protected Application(DataSource dataSource, JpaProperties properties, ObjectProvider

OpenJPA logging with slf4j on WebSphere

こ雲淡風輕ζ 提交于 2019-12-12 10:55:36
问题 My Java EE 6 application uses slf4j with logback as logging framework. Now I want to add the SQL traces of OpenJpa to my log files. The OpenJpa-Documentation says, I can use a parameter to this: <property name="openjpa.Log" value="slf4j"/> I use the WebSphere Application Server v8.0.0.1 as Java EE container. If I deploy my application to the server, this parameter does not change anything. I can change log levels in WebSphere Admin Console and this works fine. But a cannot bypass the OpenJpa

Accessing the value of eclipse classpath variable M2_REPO in run configuration VM arguments

て烟熏妆下的殇ゞ 提交于 2019-12-12 10:44:36
问题 In the run configuration of eclipse, you are provided with a set of default variables that you can use in the VM arguments, like container_path and env_var . What I want to access is a classpath variable, M2_REPO , but can't see a way of doing this. I need to specify a javaagent in the VM arguments, which requires a path to a jar file. This jar file lives in the maven repository, but I can't find a way of specifying the path to the maven repository using the already configured M2_REPO

Error while accessing EntityManager - openjpa - WAS liberty profile

落爺英雄遲暮 提交于 2019-12-12 10:06:53
问题 I’m currently working on a openjpa project on WebSphere Application Server Liberty Profile 8.5.5.7. with database being MySQL During runtime, when I'm trying to access the Entity manager , I get the error like: Caused by: javax.ejb.EJBException: See nested exception; nested exception is: java.lang.Exception: See nested Throwable at com.ibm.ejs.container.util.ExceptionUtil.EJBException(ExceptionUtil.java:461) ... 27 more Caused by: java.lang.Exception: See nested Throwable at com.ibm.ejs

How to get the exact details of OpenJPA exception for invalid data conversion?

冷暖自知 提交于 2019-12-12 04:17:36
问题 I am getting below java exception for a SELECT statement via OpenJPA which connect to DB2 database. Can someone guide me on how to exactly find which column is a mismatch? The error code ERRORCODE=-4461 does not really elaborate much. org.apache.openjpa.persistence.PersistenceException: [jcc][t4][1092][11644][3.57.82] Invalid data conversion: Wrong result column type for requested conversion. ERRORCODE=-4461, SQLSTATE=42815 at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java