eclipselink

JPA category-language relationship

早过忘川 提交于 2019-12-24 10:34:15
问题 I am building a category-based web application multilanguage using JPA/Hibernate + Spring I currently built these three beans/entities: Category, CategoryLanguage and Language. Category: @Entity public class Category implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; @ManyToOne private Category father; @OneToMany(mappedBy = "father") private List<Category> children; @OneToMany(mappedBy="category") private List<CategoryLanguage> categoryLanguages;

Avoid CHAR-trimming when using eclipselink

 ̄綄美尐妖づ 提交于 2019-12-24 10:30:03
问题 I have some Oracle-tables where some of the PK-fields are defined as CHAR(9), and all values are stored with padding. Thus, I have to retrieve all objects with space-padding in the key-fields. However, when EclipseLink reads the data into the object, the spaces are trimmed away. Since this occurs on the ID-values, there is no way for me to use @PostLoad in order to 'fix' the key so it will contain the spaces. I have no way of deleting/updating the object since the key-value is changed to a

MOXY- Multiple XSDs import the same schema definition- error: 'element' is already defined

自作多情 提交于 2019-12-24 09:27:59
问题 I have 3 XSDs linked together: schema1.xsd imports namespace="x:y:z" schemaLocation= "schemaDefinitions.xsd" includes schema2.xsd schema2.xsd imports namespace="x:y:z" schemaLocation= "schemaDefinitions.xsd" includes schema3.xsd schema3.xsd imports namespace="x:y:z" schemaLocation= "schemaDefinitions.xsd" These xsds are provided by an outside source and cannot be changed. Previously my project used standard JAXB with classes created at compile time. I currently am switching to Dynamic JAXB

JPA Transactions on Informix

五迷三道 提交于 2019-12-24 09:26:58
问题 I need to make an update on a table using JPA 2.0 with EclipseLink 3.0 on a Java SE 7.0 environment, using Non-Transactional Informix DB v. 11.50, the persistence.xml is: <persistence-unit name="pp_pu" transaction-type="RESOURCE_LOCAL"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <class>...</class> <class>...</class> <properties> <property name="javax.persistence.jdbc.url" value="jdbc:informix-sqli://10.191.78.230:40494/ptpr:informixserver=online_ptpr"/> <property

Composite Primary Key Selection- What works with Hibernate doesnt work with EclipseLink. Why?

久未见 提交于 2019-12-24 08:47:01
问题 I have two tables. CREATE TABLE profile_table ( profile_id NUMBER(10,0) PRIMARY KEY, creator_manager_id NUMBER(10,0), lastupdate DATE, description VARCHAR2(255 BYTE), profile_name VARCHAR2(255 BYTE), creatorname VARCHAR2(255 BYTE) ); CREATE TABLE profile_basket_table ( profile_id NUMBER(10,0), from_id NUMBER(10,0), action NUMBER(10,0), constraint pbt_pk_constraint PRIMARY KEY(profile_id, from_id), constraint pbt_fk_constraint FOREIGN KEY(profile_id) REFERENCES profile_table(profile_id) ); I

How to ensure load time weaving takes place for Eclipselink when using SpringBootTest with other tests running beforethe Spring one

[亡魂溺海] 提交于 2019-12-24 08:36:02
问题 I'm using Spring Rest Docs to generate documentation for my REST services. This involves running unit(strictly integration) tests that run against a live Spring Boot Container that is kicked off by the test. The test class looks like this: @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = MySpringConfiguration.class) @WebAppConfiguration public class ApiDocumentation { private MockMvc mockMvc; @Rule public final JUnitRestDocumentation restDocumentation = new

JAXB-ElipseLink: @XmlJavaTypeAdapter and the type-attribute

爷,独闯天下 提交于 2019-12-24 07:28:29
问题 I am using @XmlJavaTypeAdapter to marshal fields of type Map to XML. This results in EclipseLink-MOXy creating an xsi:type="<myValueType>" -attribute on the output xml-element. Upon validation the referenced type can of course not be found. Is there any way of suppressing the generation of this attribute? PS: An XmlAdapter-tag would be handy :) 回答1: Turns out the type-attribute had nothing to do with the @XmlJavaTypeAdapter annotation. It was caused by the fact, that the Map's elements were

Eclipselink JPARS exception “ECLIPSELINK_OXM_XML_KEY not found”

孤人 提交于 2019-12-24 07:04:01
问题 I am using Glassfish 3.1.2 and Eclipselink 2.4.1 (at least I thought so!) and derby (from Glassfish as JTA resource). When accessing the Entities in my app via "XXXX:8080/myapp/persistence/, I get the following error. Please note: the "Eclipselink Persistence Service" is reported with version 2.3.2, which looks strange to me, too. I would expect to see my configured version 2.4.1 (see below). Any ideas? INFO: JTS5014: Recoverable JTS instance, serverId = [100] INFO: [EL Info]: 2013-04-05 17

JAXB-Eclipselink: Inherited properties

情到浓时终转凉″ 提交于 2019-12-24 06:47:38
问题 I have following use-case for marshalling a POJO to XML using Eclipselink MOXy 2.3: public abstract class A { public abstract getX(); } public class B extends A { private Foo x; @Override public Foo getX() { return this.x; } } public class C extends B { // Various fields and properties here } I need to marshal B and C but not A. So i set A to be transient which makes B inherit all its members that will be marshalled when marshalling B. I cant set B to be transient since i need to marshal it

JPA/EclipseLink Returning No Results

依然范特西╮ 提交于 2019-12-24 04:48:48
问题 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 empty list as a result even though the table has over 100,000 rows. Here is my persistence.xml: <?xml version="1.0" encoding="UTF-8"?> <persistence 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_1