eclipselink

How do I solve EclipseLink's (MOXy) 'getting property “eclipselink.oxm.metadata-source” is not supported'?

血红的双手。 提交于 2019-12-11 07:23:25
问题 I've got the following piece of code which I've put together mainly based on tutorials on EclipseLink's website: Partner p = new Partner(); p.setId(1); p.setKey("a"); p.setName("this is the name"); Map<String, Source> metadataSourceMap = new HashMap<String, Source>(); metadataSourceMap.put("com.company.pas.entity.partner", new StreamSource("/com/company/pas/entity/mapping/partner-pojo2xml.xml")); Map<String, Object> properties = new HashMap<String, Object>(); properties.put

How to validate model with eclipselink jpa

孤人 提交于 2019-12-11 07:03:03
问题 I hava a model, and i need to validate model with eclipselink jpa and i add anotation @NotEmpty validate name if empty, but when i save/persist model, validate not work @Entity public class Role { @Id private String id; @NotEmpty private String name; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } my jpa configuration xml like this <?xml version="1.0" encoding=

eclipselink hints for setter updates

杀马特。学长 韩版系。学妹 提交于 2019-12-11 06:41:45
问题 The actual problem I am facing is to be able to force a eclipselink update irrespective of the content of the cache. Currently eclipselink doesn't create new update statements if the new update has the same value as in the cache. I don't want to use the refresh property( ) in the persistence xml. I am looking for a solution where I can specify to the entity being update not to use the values in the cache. EntityManager em=getEntityManager(); EntityTransaction t = em.getTransaction(); t.begin(

JPA (EclipseLink), type handling without repeated @Converter annotations?

时光毁灭记忆、已成空白 提交于 2019-12-11 06:36:36
问题 Is it possible to set a class to be serialised in a particular way by EclipseLink, without tagging it as such every time it is used? For example, say I had a class: class MyObj { private int a; private int b; public MyObj(int a, int b) { this.a = a; this.b = b; } ... } I want this to be stored in a column in the database as a string "a=1,b=2". I don't want it to be serialised to a blob, but to genuinely end up as a string in a VARCHAR column. I can do this with a converter, but I then need to

How do I configure allocationSize within persistence.xml instead of Entity

天大地大妈咪最大 提交于 2019-12-11 06:09:35
问题 Is there any possibility to do a kind of "refactor" of allocationSize in order to put it inside the perssitence.xml instead of having to configure it inside each Entity ? here's what I don't want to have : @SequenceGenerator(name="AGENT_IDAGENT_GENERATOR", sequenceName="AGENT_SEQ", allocationSize=1) here's what I'm expecting to have <properties> <property name="allocationSize" value="1"/> </properties> </persistence-unit> Thank's in advance 回答1: You could use a SessionCustomizer in your

Diagnosing an EclipseLink connection delay?

浪尽此生 提交于 2019-12-11 05:58:43
问题 I am using a GlassFish 3.1.2 server and my web application uses EclipseLink 3.1.2 as a JPA provider. GlassFish is running locally, the MySQL server is remote. The problem is that when I start my server the server hangs for a long time, with the following line as the last thing in the log. [#|2012-03-26T14:37:31.765-0700|INFO|glassfish3.1.2|org.eclipse.persistence.session.file:/Users/alan/NetBeansProjects/MyApp/target/MyApp/WEB-INF/classes/_com.myapp|_ThreadID=10;_ThreadName=Thread-3;

When I run program JPA does not create table in MySQL

本秂侑毒 提交于 2019-12-11 05:56:52
问题 Here is my entity named Class: package az.bank.entities; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table (name = "cards") public class Card implements Serializable{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String cardHolder; private String cardNumber; private String cardPassword;

EclipseLink - Query failed to prepare, unexpected error occurred

泄露秘密 提交于 2019-12-11 05:51:37
问题 When executing a command, EntityManager throws out(all https://pastebin.com/zKYBhsv8) [EL Warning]: 2017-10-14 20:07:55.332--UnitOfWork(402037615)--Exception [EclipseLink-6168] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.QueryException Exception Description: Query failed to prepare, unexpected error occurred: [java.lang.NullPointerException]. Internal Exception: java.lang.NullPointerException Query: ReportQuery(referenceClass=MovieEntity ) The

Does Seam produce an endless loop?

点点圈 提交于 2019-12-11 05:42:33
问题 I followed this tutorial to configure an application (generated by seam-gen) to use eclipselink instead of hibernate. After that the following messages appear in an endless loop after the first request from a browser ocurred. What could cause this behaviour? I was not able to find the source file which contains the string "Added Library from" to examine the issue with a debugger, any pointers are appreciated. INFO [Server] JBoss (MX MicroKernel) [4.3.0.GA_CP06 (build: SVNTag=JBPAPP_4_3_0_GA

Nested exception is java.lang.StackOverflowError

让人想犯罪 __ 提交于 2019-12-11 05:17:28
问题 I have a class @Entity @Table(name = "movies") @Data public class MovieEntity implements Serializable { ... @OneToMany(mappedBy = "movie", cascade = CascadeType.ALL) private Set<MovieRate> ratings; } which maps the list @Entity @Table(name = "movies_ratings") @Data public class MovieRate { ... } while loading movie.getRatings() the list throws me out ... at org.eclipse.persistence.indirection.IndirectSet.buildDelegate(IndirectSet.java:225) ~[org.eclipse.persistence.core-2.7.0.jar:na] at org