eclipselink

JPA 2.0 in WebLogic Server 10.3.6

最后都变了- 提交于 2019-12-21 20:38:25
问题 I need to use JPA 2.0 (with the EclipseLink implementation). The problem is that I also need to deploy this app in a WebLogic 10.3.6 server, which implements the Java EE 5 specification, and so, it is not required to support JPA 2. I know that there are patches that can be used to add support for JPA 2.0 in this version, but the sysadmin doesn't want to change anything in the server at all I tried adding the javax.persistence-2.1.0.jar file to my war thinking that my app would just use this

JPA: create EntityManagerFactory from properties

ε祈祈猫儿з 提交于 2019-12-21 20:26:17
问题 i am using JPA in a JAR-Project and used the persistence.xml to setup my EntityManager. But since the persistence.xml is inside the JAR after the build it is very complicated for the user to change the settings afterwards. So i'm looking for a solution where i can configure my connection over a propertyfile which is loaded at runtime. I came across this solution on the web: Map properties = new HashMap(); // Configure the internal EclipseLink connection pool properties.put(JDBC_DRIVER,

JPA: create EntityManagerFactory from properties

余生长醉 提交于 2019-12-21 20:26:00
问题 i am using JPA in a JAR-Project and used the persistence.xml to setup my EntityManager. But since the persistence.xml is inside the JAR after the build it is very complicated for the user to change the settings afterwards. So i'm looking for a solution where i can configure my connection over a propertyfile which is loaded at runtime. I came across this solution on the web: Map properties = new HashMap(); // Configure the internal EclipseLink connection pool properties.put(JDBC_DRIVER,

Automatic Jax-RS registration in Weblogic 12.2.1 when adding eclipselink artifact

别等时光非礼了梦想. 提交于 2019-12-21 17:33:20
问题 I have observed a very strange behavior in the latest Weblogic server, version 12.2.1.2. When an eclipselink dependency is added to your Java servlet application, Weblogic server is going to automatically trigger Jax-RS Jersey REST service under /resources/* path. To remove any doubts, I have created a very simple helloworld war file. A sample war file can be created by following the instruction from this page (http://geekabyte.blogspot.com/2015/07/how-to-create-war-files-with-intellij.html)

Select for update skip locked from JPA level

做~自己de王妃 提交于 2019-12-21 07:16:31
问题 In my application - Oracle with JPA (EclipseLink), I'm using the following expression to lock the subset of the records in some tables: select * from MY_TABLE where MY_CONDITIONS for update skip locked I run it throughout native query, but I have to write that query for all required entities. Is there any way to skip locked records using pure JPA? Can I implement my own locking policy? I don't mind changing JPA provider but I want to use JPA API. 回答1: Hibernate provides the UPGRADE_SKIPLOCKED

EclipseLink native query result into POJO - Missing descriptor for [Class]

喜欢而已 提交于 2019-12-21 07:02:14
问题 I'm using EclipseLink to run some Native SQL. I need to return the data into a POJO. I followed the instructions at EclipseLink Docs, but I receive the error Missing descriptor for [Class] The query columns have been named to match the member variables of the POJO. Do I need to do some additional mapping? POJO: public class AnnouncementRecipientsFlattenedDTO { private BigDecimal announcementId; private String recipientAddress; private String type; public AnnouncementRecipientsFlattenedDTO() {

JPA Eclipselink Database Change Notification does not invalidate cache entry

点点圈 提交于 2019-12-21 06:36:09
问题 I have two Java 1.7 applications using Eclipselink 2.4.2 for persistence. One application is a JEE application running in Glassfish 3.1.2.2 and the other is a Java SE application. These applications read and write the same data, so there is the possibility of stale JPA cache entries. I am attempting to use Oracle DCN to solve the stale cache problem. I have configured my persistence.xml as described in the link above: <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun

Exception : “Missing class indicator field from database row [UnmarshalRecordImpl()].” when unmarshalling XML using EclipseLink JAXB (MOXy)

99封情书 提交于 2019-12-21 06:04:48
问题 Is it any way to unmarshalling with @XmlDescriminatorNode/@XmlDescrimintatorValue annotations next XML, or any workaround: <assets> <asset type="full"> <data_file role="source"> <locale name="ru-RU"/> </data_file> <data_file role="extension"> <locale name="ru-RU"/> </data_file> <data_file> <locale name="ru-RU"/> </data_file> </asset> </assets> My mapping classes: @XmlRootElement(name="data_file") @XmlAccessorType(XmlAccessType.FIELD) @XmlDiscriminatorNode("@role") public abstract class

Eclipselink history of related objects

家住魔仙堡 提交于 2019-12-21 05:08:47
问题 I can create history of an entity with a HistoryCustomizer @Entity @Customizer(MyHistoryCustomizer.class) public class Employee {..} the HistoryCustomizer is something like this one: public class MyHistoryCustomizer implements DescriptorCustomizer { public void customize(ClassDescriptor descriptor) { HistoryPolicy policy = new HistoryPolicy(); policy.addHistoryTableName("EMPLOYEE_HIST"); policy.addStartFieldName("START_DATE"); policy.addEndFieldName("END_DATE"); descriptor.setHistoryPolicy

Eclipselink history of related objects

偶尔善良 提交于 2019-12-21 05:07:03
问题 I can create history of an entity with a HistoryCustomizer @Entity @Customizer(MyHistoryCustomizer.class) public class Employee {..} the HistoryCustomizer is something like this one: public class MyHistoryCustomizer implements DescriptorCustomizer { public void customize(ClassDescriptor descriptor) { HistoryPolicy policy = new HistoryPolicy(); policy.addHistoryTableName("EMPLOYEE_HIST"); policy.addStartFieldName("START_DATE"); policy.addEndFieldName("END_DATE"); descriptor.setHistoryPolicy