eclipselink

Jubula PostgreSQL Database connection failed

南楼画角 提交于 2019-12-25 03:19:17
问题 I get this error when I try to connect to a Jubula database. 2000 Exception [EclipseLink-4003] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException Exception Description: Configuration error. Class [org.postgresql.Driver] not found. I guess EclipseLink does not know how to connect. (Using: Eclipse 4.4 for Testers) Can someone tell me how can I install the Postgre-JDBC driver's jar, in order to make it work? 回答1: Okay, I've found it;

QueryHint “ResultSetType.ForwardOnly” fails with Spring JPA/EclipseLink

蓝咒 提交于 2019-12-25 03:12:12
问题 I am facing a problem when setting q.setHint(QueryHints.RESULT_SET_TYPE, ResultSetType.ForwardOnly); for SQL query. I want to use this hint because I expect a large result set and want to avoid memory problems. I am using Spring JPA in combination with EclipseLink. The stack trace is Exception [EclipseLink-6057] (Eclipse Persistence Services - 1.1.0.r3634): org.eclipse.persistence.exceptions.QueryException Exception Description: The method [getContainerClass()] is not a valid method to call

Why is JPA ignoring my @OrderColumn in a basic use case?

时光毁灭记忆、已成空白 提交于 2019-12-25 03:07:04
问题 Inspection Entity: @Entity @Table(name="INSPECTION") public class Inspection implements Serializable { ... @OneToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE}, orphanRemoval=true) @OrderColumn(name="LIST_INDEX", nullable=false) @JoinColumn(name="INSPECTION_ID") private List<RecommendationInstance> recommendations; ... } RecommendationInstance Entity @Entity @Table(name = "RECOMMENDATION_INSTANCE") public class RecommendationInstance implements Serializable {

Jpa implementing eclipse link with sql server 2008R2

可紊 提交于 2019-12-25 02:58:21
问题 Hello i have been trying to persist jpa entity class into sql server 2008 R2 database.But i get some problems.The problem which i'am posting now is already in stack overflow but its unsolved [EL Info]: 2014-07-05 21:06:30.965--ServerSession(2052069)--EclipseLink, version: Eclipse Persistence Services - 2.5.0.v20130507-3faac2b [EL Info]: connection: 2014-07-05 21:06:37.337--ServerSession(2052069)--file:/D:/eclipse/workspace/JpaExamples/build/classes/_User login successful [EL Warning]: 2014-07

Wrong autoincrement value in sqlite using JPA

早过忘川 提交于 2019-12-25 02:18:08
问题 I'm working on a simple project using sqlite, JPA and eclipseLink. First I create my Person table in my database with this: CREATE TABLE Person ( idPerson INTEGER PRIMARY KEY AUTOINCREMENT, firstname TEXT DEFAULT 'NULL', birthdate DATETIME DEFAULT 'NULL' ) and then add a new test entry (in order to generate the sqlite_sequence table) INSERT INTO [Person] ([firstname], [birthdate]) VALUES ('Foo', '1145-11-12 00:00:00') All the successive insertion are done using JPA, where in the Person class

How to avoid persisting new object when oneToMany connection?

对着背影说爱祢 提交于 2019-12-25 02:09:23
问题 There is a three lines in returnreason-table and I don't want more lines there. User just choose one of the three reasons and I want only id to rma-table. Now it inserts a new line to reason-table every time when inserting new rma. I can take relation off between the tables but I wonder if there is better solution to avoid inserting new lines when persisting rma object? If I take cascadeType off from the class Rma, it is not helping/working. Then I got an error message, that jpa found an

Is it possible to use @Transational worked in Spring, Eclipselink &Tomcat environment?

梦想与她 提交于 2019-12-25 01:43:11
问题 HiAll, I was confused by the EclipseLink for Tomcat documentation saying: Limitations to JPA: No @PersistenceContext injection of a container managed persistence unit is available - use Persistence.createEntityManagerFactory(JTA_PU_NAME) and, also by this question&answer: but the typical JPA configuration in Spring looks like this, so you don't need to create EntityManager manually : @PersistenceContext private EntityManager em; So, the question is: may I use this annotation

Calling Oracle function with StoredProcedureQuery?

扶醉桌前 提交于 2019-12-24 21:26:52
问题 I'm trying to call an Oracle PL/SQL function using javax.persistence.StoredProcedureQuery and I get the error PLS-00221: 'function_name' is not a procedure or is undefined So I assume its not possible to call an Oracle function using StoredProcedureQuery? I don't see JPA offering an interface to call functions(as opposed to stored procedures). So how do I accomplish it? 回答1: Sample Oracle Function: CREATE OR REPLACE FUNCTION f_get_random_number RETURN NUMBER AS BEGIN RETURN TRUNC(dbms_random

classcast exception in JPA while saving images to the database

最后都变了- 提交于 2019-12-24 17:31:12
问题 I am facing some issues when I write images to the database using JPA. I am getting below classcastexception. I have attached the code as well. [EL Warning]: 2012-03-12 12:02:58.757--UnitOfWork(23191477)--java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number Code: import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence

My entities are not persisting showing javax.persistence.TransactionRequiredException

懵懂的女人 提交于 2019-12-24 16:47:53
问题 I have recently migrated to JPA 2.0 (EclipseLink 2.4.2 Juno) in TomEE 1.7 in Eclipse IDE, As i am storing the values they are getting stored and retrieved fine, but they are not persisting into the database when is use entitymanager.flush() it is showing javax.persistence.TransactionRequiredException Here is my code Create.java (register method) public static int register(String first, String last, String email, String date, String phone, String address, String pin, Login login) { try {