openjpa

OpenJPA 2.1.1 enhancement problem on Glassfish 3.1.1

微笑、不失礼 提交于 2019-12-05 22:09:28
My problem is this exception: Caused by: <openjpa-2.1.1-r422266:1148538 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: " I'm trying to get an very simple java application with jsf and jpa running, but there seems to be a problem with the enhancement of my entities. As far as I know, tries OpenJPA to enhance my entities at runtime, which are listet in the persistence.xml , however there is no agent to do this. The

How do I configure OpenJPA SQL logging?

我的梦境 提交于 2019-12-05 14:24:12
问题 What is the OpenJPA configuration to view SQL query executed in a database? I would like to view the query with all parameters executed in log or console instead of viewing the JPQL query 回答1: <property name="openjpa.Log" value="SQL=Trace" /> Enables logging of all SQL statements, minus parameter values. <property name="openjpa.ConnectionFactoryProperties" value="PrintParameters=true" /> Enables logging of SQL parameters. Logging documentation 回答2: If you're using log4j, you can setup your

JPA 1.0 error: The name is not a recognized entity or identifier. Known entity names: []

隐身守侯 提交于 2019-12-05 13:41:19
I am getting following exception while I try to execute simple JPA 1.0 code. What may be the cause? 5453 DevPQRWDPBSSPersist WARN [P=351601:O=0:CT] openjpa.Enhance - This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "[class com.XYZ.PQR.bss.client.db.data.markerentry, class com.XYZ.PQR.bss.client.db.data.Serviceproduct, class com.XYZ.PQR.bss.client.db.data.Agreementterms, class com.XYZ.PQR.bss.client.db.data.Offeringattribute, class com.XYZ.PQR.bss.client.db.data.marker, class com.XYZ.PQR.bss

How can I use typcasting inside a JPQL statement?

守給你的承諾、 提交于 2019-12-05 06:03:20
I have two Integer columns in the database (derby and db2). I need to divide them with each other inside a JPQL . Both columns being of type Integer return zero if remainder is a decimal number e.g 0.25 becomes 0 etc and understandably so since type is int. In SQL I could have this for example select CAST(column1 as decimal(6,2))/CAST(column2 as decimal(6,2))from Sometable; but what is JPQL equivalent . One option might be (I have not tried yet) is to have a @Transient method in the entity returning the Decimal type and doing this calculation there and pass that to JPQL but I would rather let

OpenJPA Wrong order for delete of child when deleting parent

 ̄綄美尐妖づ 提交于 2019-12-05 05:27:58
The order of deletes for OpenJPA 2.3.x are happening in the wrong order and I can't figure out why. Given these JPA mappings // grandparent @Entity @Table(name = "three_phase_motor_input") public class ThreePhaseMotorInput implements IThreePhaseMotorInput, Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Version private Integer version; @OneToOne(orphanRemoval = true, cascade = CascadeType.ALL, optional = true, targetEntity = UnapprovedThreePhaseMotor.class) @JoinColumn(name = "unapproved_id") private IThreePhaseMotor unapprovedMotor; // parent @Entity

java.lang.ClassCastException: [B cannot be cast to java.lang.String

怎甘沉沦 提交于 2019-12-05 05:04:48
I have written an entitity class with Field LoginId and Password. Iam encrypting the passwrd and stoiring it in the db using the AES_ENCRYPT. I want to retrive only the password which is decrypted. so, im using AES_DECRYPT using NAtiveQueryis in OPen JPA 2.0. Query i have written is : Query q = em.createNativeQuery("select AES_DECRYPT(l.password,?2) from loginDetails l where l.loginID = ?1"); q.setParameter(1, loginId); q.setParameter(2, getKey()); String s = q.getSingleResult(); But im getting the following exception: java.lang.ClassCastException: [B cannot be cast to java.lang.String at com

selecting all rows from a database using JPA in WebSphere

随声附和 提交于 2019-12-04 22:57:25
I am trying to implement a web service that uses open JPA to access the data layer. I am using websphere v7.0 and JPA 2.0. This service is going to get all rows out of a small db (about 6 rows and it won't expand much at all in the future). I am attempting to get all rows and return them through the user. I am right now creating the Session Bean that will retrieve the data. I have several JPA objects one of them (representing a row of all the data I want to return) looks like so... @Entity @NamedQueries({ @NamedQuery(name="EmailDomainTrust.getEmailDomains", query="SELECT DOMAIN_NAME,"+

Custom ClassLoader not garbage collected

允我心安 提交于 2019-12-04 21:57:24
In an attempt to solve this problem , I built a (very) small project that is reproducing part of it. It is a NetBeans project using Glassfish v2.1.1 and OpenJpa-1.2.2. Globally, the goal is to be able to reload dynamically some business code (called 'tasks') without the need to (re)make a full deployment (eg via asadmin). In the project there are two of them: PersonTask and AddressTask which are simply accessing some data and printing them out. In order to do that, I've implemented a custom class loader that read the binary of class files and inject it via the defineClass method. Basically,

OpenJPA - Transaction management is not available… (Fuse ESB)

﹥>﹥吖頭↗ 提交于 2019-12-04 16:03:08
I'm having trouble with RESOURCE_LOCAL transaction type for JPA in Fuse ESB. I also don't have a complete understanding of whether JTA or RESOURCE_LOCAL is better for me. My persistence.xml : <persistence-unit name="invoicePersistence" transaction-type="RESOURCE_LOCAL"> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/invDataSource)</jta-data-source> <non-jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/invDataSource)</non-jta-data-source> <class>com.company

Nullable Date column merge problem

怎甘沉沦 提交于 2019-12-04 12:32:14
I am using JPA with openjpa implementation beneath, on a Geronimo application server. I am also using MySQL database. I have a problem with updating object with nullable Date property. When I'm trying to merge entity with Date property set to null, no sql update script is generated (or when other fields are modified, sql update script is generated, but date field is ommited from it). If date field is set to some other not null value, update script is properly generated. Did anyone have problem like that? OpenJPA makes certain assumptions when you've detached (and presumably serialized) an