eclipselink

jetty-maven-plugin and loadTimeWeaver

折月煮酒 提交于 2019-12-09 09:03:59
问题 can't seem to have my spring webapp working with jetty-maven pluging i always get org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadTimeWeaver': Initialization of bean failed; nested exception is java.lang.IllegalStateException: ClassLoader [org.eclipse.jetty.webapp.WebAppClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:org

How to configure an eclipselink JTA sequence connection pool

安稳与你 提交于 2019-12-09 07:16:25
I have been having concurrency problems with TABLE sequences on MySQL and found advise that the solution may be configuring a separate connection pool for sequence generation. In this stackoverflow question it points to the Eclipselink Documentation which has a section for an example that's empty. I can't seem to find any example of how this is configured. My persistence.xml at the moment is below. What should I change to ensure sequence generation is executed on a seperate transaction / connection pool. It would also be great to know what I should look for to determine it's working, other

Multiple writable mappings in JPA?

可紊 提交于 2019-12-09 05:50:30
I would like to make a review about some user at my system, this review is made by others users. So here it's my user's table: And this is my user_review table: The EclipseLink is generating like this (actually it insted of @PrimaryJoinColumn was @JoinColumn it change it because of this post ): @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Integer id; @Temporal(TemporalType.DATE) private Date date; private String review; //bi-directional many-to-one association to User // @PrimaryKeyJoinColumn(name="id_user_reviewer") @ManyToOne @JoinColumn(name="id_user_reviewer") private User

JPA (Hibernate, EclipseLink) mapping: why doesn't this code work (chain of 2 relationships using JPA 2.0, @EmbeddedId composite PK-FK)?

百般思念 提交于 2019-12-09 03:34:40
问题 I have three tables: CREATE TABLE PostAddresses ( contact_id INTEGER NOT NULL, ordinal_nbr SMALLINT NOT NULL, PRIMARY KEY (contact_id, ordinal_nbr) ); CREATE TABLE Foos ( contact_id INTEGER NOT NULL, ordinal_nbr SMALLINT NOT NULL, PRIMARY KEY (contact_id, ordinal_nbr), FOREIGN KEY (contact_id, ordinal_nbr) REFERENCES PostAddresses (contact_id, ordinal_nbr) ); CREATE TABLE Bars ( contact_id INTEGER NOT NULL, ordinal_nbr SMALLINT NOT NULL, numba INTEGER NOT NULL, PRIMARY KEY (contact_id,

How to store date-time in UTC into a database using EclipseLink and Joda-Time?

一曲冷凌霜 提交于 2019-12-09 03:23:43
问题 I have been fumbling with the following EclipseLink Joda-Time converter for a long time to store date-time in UTC into MySQL database with no success at all. import java.util.Date; import org.eclipse.persistence.mappings.DatabaseMapping; import org.eclipse.persistence.mappings.converters.Converter; import org.eclipse.persistence.sessions.Session; import org.joda.time.DateTime; public final class JodaDateTimeConverter implements Converter { private static final long serialVersionUID = 1L;

Problems with generating sql via eclipseLink - missing separator

♀尐吖头ヾ 提交于 2019-12-09 02:47:35
问题 i'am using eclipseLink with jpa. in my persistence.xml, i defined to generate a create.sql file. the file will be generated, but with missing ';'-separators for each sql statement. is there a possibility to define a separator in the persistence.xml or in some other way? Example persistence.xml: <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <exclude-unlisted-classes>false</exclude-unlisted-classes> <class>de.company.project.models.User</class> <properties> <property name

Running EclipseLink metamodel generator in sbt?

走远了吗. 提交于 2019-12-08 12:21:06
问题 Using sbt, what should I do to execute annotation processor org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor provided by EclipseLink in order to generate the metamodel from my entity classes? 回答1: For the impatient Clone project ssdemojpa $ git clone http://github.com/frgomes/ssdemojpa Enter the commands below from the SBT console: zap reload metamodel compile test Detailed Description Project ssdemojpa provides a demo about how PlayFramework can be integrated with

JPA and SYS_REFCURSOR like OUT parameter

╄→尐↘猪︶ㄣ 提交于 2019-12-08 11:00:18
问题 I want to call a procedure using JPA with SYS_REFCURSOR like OUT parameter. This is very easy using plain JDBC but I'm not sure that is possible in JPA. My procedure is like following: CREATE OR REPLACE FUNCTION FN_GET_COINS RETURN SYS_REFCURSOR IS vCursor SYS_REFCURSOR; BEGIN OPEN vCursor FOR SELECT ... RETURN vCursor; CLOSE vCursor; EXCEPTION ... END FN_GET_COINS; 回答1: JPA 2.0 has no support for stored procedures, but support has been added in JPA 2.1 , part of Java EE 7 . Examples of

spring jpa create double parenthesis query

拈花ヽ惹草 提交于 2019-12-08 09:28:51
问题 I'm using Spring Boot with JPA (EclipseLink) and Oracle 11. I have CrudRepository interface: public interface TransportDefRepository extends CrudRepository<TransportDef, Long> { public List<TransportDef> findByNameInOrderByNameAsc(List<String> names); } Calling findByNameInOrderByNameAsc method creates query: SELECT ID, NAME, FROM TRANSPORT_DEFS WHERE (NAME IN (('A','B'))) ORDER BY NAME ASC and Oracle throws exception: ORA-00907: missing right parenthesis Am I doing something wrong? Why there

Spring + Eclipselink + JtaTransactionManager = javax.persistence.TransactionRequiredException

核能气质少年 提交于 2019-12-08 09:10:36
问题 I really hope you can help me. I've been looking all over the internet for answers and none of them works. I use Spring 3 + JTA + EclipseLink but i'm getting a TransactionRequiredException when flushing a transaction. Now i'm very used to just defining my persistence context and injecting the EntityManager and the transaction is handled by the app server. So here's what I've got. persistence.xml <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3